Re: getting an object x in an external method that can be passed as context to ContentInit( ... ).initialize(context)
Martin Aspeli <[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(...). This sounds a little insane - can you tell us a bit more about why your're doing it, and what your use case is? Martin (blah blah blah gmane is stupid blah blah blah i can't post until i put in more rubbish than the above quoted text blah blah and don't even get me started on top-quoting blah blah etc. blah blah) ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click