[Zope] calling an Python builtin function

Steve Alexander steve@cat-box.net
Wed, 24 May 2000 00:40:28 +0100


Felipe Alvarez Harnecker wrote:
> 
> Hi Zopistas,
> 
> it's a pain looking to variables defined in a form such as checkboxes
> that can be a string if one is selected or a sequence if many are.
> 
> to solve this problem i'd like to do something like:
> 
> <dtml-let checkbox="list(checkbox)">
> ...
> ...
> </dtml-let>
> 
> That is, calling the list function of Python on checkbox.
> 
> But that doesn't work, neither <dtml-let checkbox="_.list(checkbox)">
> 
> Beside of this, is there a way to test if foo is a string or a
> sequence or whatever ??

Sounds like you might want this

  http://www.zope.org/Members/Zen/howto/FormVariableTypes

Coerce your form fields into the types you require by using magic
incantations of the form variablename:type.

--
Steve Alexander
Software Engineer
Cat-Box limited