[Zope] sequence / int handling (DTML)

Dieter Maurer dieter@handshake.de
Fri, 27 Jun 2003 00:43:25 +0200


David Siedband wrote at 2003-6-24 16:33 -0700:
 > I have a DTML page where users can choose location(s) to link to a 
 > hypothesis.  So there's an HTML multiple selection field.  I have code 
 > that calls SQL to insert multiple selections and code that calls the 
 > SQL insert for a single entry.  My question is how do get Zope to 
 > differentiate between the two scenarios and use the appropriate code.  

The easiest way is not to have two scenarios but a single one (a list).
You can use the ":list" type suffix for your control variable.
Details in

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

You can also use "_.same_type" to check the type of your variable.
Sometimes, this might be necessary. In your special case, it would
be suboptimal.


Dieter