[Zope] Using a multiple_selection property in a product

Randall F. Kern randy@spoke.net
Wed, 3 Jan 2001 15:16:39 -0800


Try this:

_properties = (....
	{'id':'classdays', 'type':'multiple selection','mode':'w',
'select_variable': 'days'},
...)

days = (
	'Monday',
	'Tuesday',
	'Wednesday',
	'Thursday',
	'Friday'
)

-Randy


-----Original Message-----
From: Ronald L. Roeber [mailto:rroeber1@unl.edu]
Sent: Wednesday, January 03, 2001 2:48 PM
To: zope@zope.org
Subject: [Zope] Using a multiple_selection property in a product


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






_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )