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]> |
> Suresh's answer sounds much better than my solution, that I give > below. What you're doing is quite crazy (and a little bit cool). I haven't played with ATSchemeEditorNG, but I thought that it would be a way to achive this type of thing, without any crazy on-the-fly content creation. A few other points: - Subclass RichDocument and modify the schema and whatever else you need, don't copy the source. This makes it easier to re-use. - If you must create classes on the fly, my guess would be that you'd have to do what __init__.py in a typical product does when the content object is being created. Whether this works outside Zope startup, I have no idea. You'd also need to cache that somehow and run it during __init__.py on the generator product as well. - Install.py does a lot of things. You probably dont' need to register skin directories, for one thing. About the rest of what it does, you'll have to understand it and do it on a case-by-case basis. - You won't need external methods (they are a pain). Any filesystem code (i.e. not a pyscript in skins/<yourproduct>/*.py) can do the kinds of things Install.py's install() method does. Hence, you could do this e.g. in a tool or a method on your parent type. - It'd be better if you coded in English, since most developers are English. I can't follow your examples because I don't speak Spanish (?), and hence I'll never be able to help you with your code... Also, the python syntax is in English, and you seem to speak it quite well, so... - I still thing this is nuts :-) Martin ------------------------------------------------------- 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