[Zope] define a class in a python script
Dieter Maurer
dieter at handshake.de
Wed Mar 5 13:28:11 EST 2008
Yuri wrote at 2008-3-5 10:43 +0100:
> ...
>An external method can load only a function, not a class, so really I
>need to write a product just only for a class?
An external method can define classes (but you can not store their instances
persistently) and it can import classes from arbitrary
Python modules and packages (their instances can be stored persistently).
When untrusted code should access the instances, do not forget
to add security declarations and activate them.
You find details in the Zope Developper Guide (it is old but still
describes Zope 2 quite well).
Note that instances that should get indexed usually need to
support "getPhysicalPath" and they usually need to be retrievable
under the path returned by their "getPhysicalPath".
This may not be fully easy to achieve.
--
Dieter
More information about the Zope
mailing list