[Zope] What's the type of something marshalled to a "record"?
Jean Jordaan
jean@upfrontsystems.co.za
Sat, 26 Jan 2002 12:51:11 +0200
Hi all
Short version of my question: how do I know when a form variable
has been marshalled to a record? _.same_type(var, ????)
Long version:
If I do this:
<p> <input
name="properties_to_show.ContactPerson:record:list"
type="checkbox"
value="id"> id
<br> <input
name="properties_to_show.ContactPerson:record:list"
type="checkbox"
value="Category"> Category
[...]
I can successfully do this:
<dtml-let p2s="REQUEST.form['properties_to_show']">
<dtml-in "p2s.keys()">
<dtml-var sequence-item>
</dtml-in>
</dtml-let>
But if I do this:
<dtml-let p2s="REQUEST.form['properties_to_show']">
<dtml-if "_.same_type(p2s, {})"> it's a dict!
<dtml-elif "_.same_type(p2s, p2s)"> it's it!
</dtml-if>
</dtml-let>
then I get "it's it!" instead of "it's a dict!".
The question again: how do I know when a form variable has been
marshalled to a record? _.same_type(var, ????)
Lots of TIA ..
Jean Jordaan