[Zope] define a class in a python script

Yuri yurj at alfa.it
Wed Mar 5 05:17:00 EST 2008


Tino Wildenhain wrote:
> Yuri wrote:
>> Hi, all!
>>
>> I would like to define a class inside a python script (so I can 
>> catalog it and use catalog to store info, as the tutorial about 
>> catalog everything suggests).
>
> Its not possible in Python Scripts. You would need to write either
> an external method or a small product.

http://www.faqs.org/docs/ZopeBook/ScriptingZope.html

You also cannot easily hand instances of your own classes over to DTML 
or scripts. The issue here is that your instances won't have Zope 
security information. You can define and use your own classes and 
instances to your heart's delight, just don't expect Zope to use them 
directly. Limit yourself to returning simple Python structures like 
strings, dictionaries and lists or Zope objects.

So developing a product, is the only option?


More information about the Zope mailing list