[Zope] Problems extracting property type from a ZClass?

Darran Edmundson Darran.Edmundson@anu.edu.au
Sat, 10 Jun 2000 23:42:51 +1000


I'm trying to automatically extract the property names,
types and default values from the propertysheet of a
class.  I'm being foiled by the following bit of
strangeness.

Consider the following snippet of DTML:

<dtml-in "propertyIds()">
   <dtml-let pid="_['sequence-item']">
       <dtml-var pid> <dtml-var "getProperty(pid)">
          <dtml-var "getPropertyType(pid)"><br>
   </dtml-let>
</dtml-in>

When run in a "normal" location (ie., outside of the
Products hierarchy), it acts as expected giving
a list of properties, values *and* their type.  E.g.,

   title Zope string
   selectionChoices ['selection1', 'selection2'] lines
   date_prop 2000/01/01 date

However, wrapped in a <dtml-with
"Control_Panel.Products.TestProduct.TestClass.propertysheets.common.properti
es">
</dtml-with>, I'm getting the name and value, but not the type, viz.

   p_string test_string None
   p_date 2000/01/01 None
   p_boolean on None
   p_float 3.1415 None
   p_int 10023 None
   p_lines ['line1', 'line2', 'line3'] None
   p_text this is a test entry of a text box. None
   p_tokens ['token1,token2,token3'] None
   p_selection None
   p_multi_selection None

Any ideas?

Cheers,
Darran.