[Zope] Accessing select_variable within a Python product

Jon Whitener wmmail@twmi.rr.com
Wed, 05 Feb 2003 17:36:06 -0500


I'm trying to develop my first Python product, whose main object class is CableChannel.  One of CableChannel's properties is a multiple selection, categories, as below:

    _properties = (
        # ...Other properties...
        {'id': 'categories', 'type': 'multiple selection',
         'select_variable': 'channel_categories', 'mode': 'w'},
        )

Within the module, I've assigned a list of strings to channel_categories, but I'm confused about how to access (and 'tal:repeat' over) channel_categories from the product's add form, manage_addCableChannel form (a ZPT).

If I assign channel_categories within the CableChannel class / module, how can I access the list from the add form, which lies in a subfolder of the CableChannel directory in the Products directory?

Moreover, is there a better place to define channel_categories so that it is more easily accessible not only from the add / edit forms of the product, but also from Zope instance space?

(I originally created this class as a ZClass, and channel_categories was a Script (Python) in instance space Root, so I could access it anywhere in instance space.)

Thanks in advance,

Jon Whitener
Detroit Michigan USA