[Zope] Using a multiple_selection property in a product

Ronald L. Roeber rroeber1@unl.edu
Wed, 03 Jan 2001 16:48:03 -0600


I am attempting to build a product that will contain some unique
information and access control for services in  support of college
classes. Many, many things are going well...better than expected.
However I am having problems getting the product to correctly recognize
a multiple selection property. The property is the days of the week that
the course is offered. ( Monday-Wednesday-Friday or Tuesday-Thursday, or
any combination thereof)

The DTML for the product creation form contains the following:
---
   <th align="LEFT" valign="TOP"><em>Days Course Offered</em></th>
   <td align="LEFT" valign="TOP">
       <select name="classdays:multiple_selection" size=5 multiple>
        <option value="Monday">Monday</option>
        <option value="Tuesday">Tuesday</option>
        <option value="Wednesday">Wednesday</option>
        <option value="Thursday">Thursday</option>
        <option value="Friday">Friday</option>
       </select>

----
in the product class I have tried two tactics (actually more but I'll
confess to only these two)

_properties(....
                {'id':'classdays',
'type':'multiple_selection','mode':'w'}, ...

RESULT: product installs, but classdays in an "unknown property type"

so I try this:

_properties(....
                {'id':'classdays', 'type':'multiple
selection','mode':'w'}, ...

RESULT: product installs, however the Properties are unavailable,
furthermore trying to view the properties by clicking on the Properties
tab generates the following Zope error:

Error Type: NameError
Error Value: select_variable

[somewhat helpful troubleshooting suggestions]

Traceback (innermost last):
  File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line
222, in publish_module
  File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /home/Zope-2.3.0a1-src/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/mapply.py, line 160,
in mapply
    (Object: manage_propertiesForm)
  File /home/Zope-2.3.0a1-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: manage_propertiesForm)
  File /home/Zope-2.3.0a1-src/lib/python/App/special_dtml.py, line 120,
in __call__
    (Object: manage_propertiesForm)
    (Info: /home/Zope-2.3.0a1-src/lib/python/OFS/properties.dtml)
  File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_String.py,
line 528, in __call__
    (Object: manage_propertiesForm)
  File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_In.py, line
691, in renderwob
    (Object: propertyMap)
  File /home/Zope-2.3.0a1-src/lib/python/DocumentTemplate/DT_Util.py,
line 337, in eval
    (Object: hasProperty(select_variable))
    (Info: hasProperty)
  File <string>, line 0, in ?
NameError: (see above)
-----------------

I've also tried to use :list with much less success.  Any helpful
suggestions would be appreciated. The solution is not obvious to me.
TIA...

Ron Roeber
University of Nebraska