[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Zope Products

webmaster@zope.org webmaster@zope.org
Tue, 29 Oct 2002 05:21:55 -0500

A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/Products.stx#4-38


        For 'selection' and 'multiple selection' properties, you must
        include an addition item in the property dictionary,
        'select_variable' which provides the name of a property or
        method which returns a list of strings from which the
        selection(s) can be chosen. For example::

          _properties=({'id' : 'favorite_color', 
                        'type' : 'selection',
                        'select_variable' : 'getColors'

          % Anonymous User - Aug. 23, 2002 11:00 am:
           Could we have an example of the property or method 'getColors' please? I cannot figure out how to create the
           options list and nominate the default selected item.

          % Anonymous User - Oct. 28, 2002 6:33 am:
           I second that!

          % Anonymous User - Oct. 29, 2002 5:21 am:
           getColors = ['red','blue','green']  

           or a bit fancy  
           def getColors(self):  
             """return colors"""  
             return somelistwithcolors