[Zope] define a class in a python script

Yuri yurj at alfa.it
Wed Mar 5 05:26:58 EST 2008


Andreas Jung wrote:
>
>
> --On 5. März 2008 10:21:32 +0100 Yuri <yurj at alfa.it> 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).
>>
>>
>
> This is basically bad-style. Define your class somewhere in your 
> product code and if necessary make it available through related APIs 
> of the AccessControl module.

The class has not to be made available, just a "bridge" to catalog it. 
For example, ZSQL method has a class file, so it is not a problem nor a 
"bad style" to define it somewhere and use it internally.

what I need to do is my_catalog.catalog_object(an_object, 'path')

So I can index values and search for them, without having objects.

 The idea is taken from here:

http://zope.org/Members/rbickers/cataloganything


More information about the Zope mailing list