[Zope] How to write a ZClass constructor method in PythonScript?

Dirksen dirksen_lau@yahoo.com
Tue, 20 Feb 2001 17:59:05 -0800 (PST)


Inside a ZClass A (extended from objectManager), I define another ZClass B, here is
what's in the default contstructor dtml method for B:
<dtml-with "B.createInObjectManager(REQUEST['id'], REQUEST)">
...
</dtml-with>

Well, I rewrite it in PythonScript, and modify the factory and add_form to point to this
new method. The script is like:
req = context.REQUEST
container.B.createInObjectManager(req['id'], req)

I think the PythonScript verion is equivalent to the DTML verion. But in the experiment,
the PythonScript complains that B is not a attribute of the container, i.e. an instance
of ZClass A, while the DTML works fine. Why is the ZClass definition not exposed to
PythonScript? Any hints please!

Cheers
Dirksen





__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/