[Zope] finding the type of an object

Allen Wallis allen@rrsg.ee.uct.ac.za
Mon, 03 Apr 2000 14:08:44 +0200


Hi,
I need to test the type of an object for the following reason:
I have a form, one of the inputs being a <SELECT NAME="name" MULTIPLE>
etc.

Now, when there are more than one item selected in this <SELECT> list,
then the variable
<dtml-var name> is a list (think) which can be used in a <dtml-in name>
</dtml-in> iteration. The problem is if the user selects one item, then
the variable "name" is a string, containing the one item that was
selected. The problem is that if one simply does a <dtml-in name>
iteration without checking the type of the variable "name", then the
method will fail when the user only selects one item from the list.
Hence I need to know the type of the variable "name". How do I find this
out? Is it possible to call the python function type() from within a
dtml method? If not, how else does one handle this situation?

thanks
Allen