getting an object x in an external method that can be passed as context to ContentInit( ... ).initialize(context)
Enrique Pérez Arnaud <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
I am trying to write a folderish Archetypes-based content type (by name of 'Almacen') that, on instantiation, will create a new content type on the fly. This creation starts from a mutator of a text field of the 'Almacen' content type, from which the new content type takes its name. The idea is to have its schema managed by the 'Almacen' instance, which inherits from SchemaEditor from ATSchemaEditorNG. I also want to be able to establish relations (from the Relations product) between different content types, so I cannot work on the lines of GenericPloneContent (I guess i need a fully fledged archetype.) What I am doing, is to create a class in the mutator with type.__new__(type, ... ), call registerType, and then call an external method that installs the new content type. The problem I am finding is getting an object (in the external method or in the mutator method) that can be passed as context to ContentInit( ... ).initialize(context), i.e., an object x that can do x.registerClass(...). I am using Zope-2.8.3 and Plone-2.1.1 -- Enrique Pérez [email protected]