[Zope-dev] getPropertyType returns None in ZClass

Alexandre Ratti alex@gabuzomeu.net
Sun, 21 Nov 1999 14:58:29 +0100


Hello,


I tried to list all properties in a ZClass instance and check their types. 
I used the following code (within the ZClass; 'infos' is a custom 
propertysheet name):

<dtml-in "propertysheets.infos.propertyIds()">
  <LI><dtml-var sequence-item> -
      <dtml-var "getPropertyType(_['sequence-item'])"> -
      <dtml-var "hasProperty(_['sequence-item'])">
</dtml-in>
</UL>

This is the result:

      title - string - 1
      description - None - 0
      adresse - None - 0
      modele_lien - None - 0
      lien - None - 0

The property names are available but all properties except built-in 'title' 
are described as missing (though they do store data I can retrieve and 
display). This doesn't happen when I run the same code on a standard object 
type outside a Zclass. Also, the propertyMap() method returns the correct 
info. Eg.:

<UL>
<dtml-in "propertyMap()">
  <LI><dtml-var sequence-item>
</dtml-in>
</UL>

returns

      {'id': 'title', 'type': 'string', 'meta': {}, 'mode': 'w'}
      {'id': 'description', 'type': 'text', 'meta': {}, 'mode': 'w'}
      {'id': 'adresse', 'type': 'string', 'meta': {}, 'mode': 'w'}
      {'id': 'modele_lien', 'type': 'string', 'meta': {}, 'mode': 'w'}
      {'id': 'lien', 'type': 'string', 'meta': {}, 'mode': 'w'}


What did I missed?


Thanks.

Alexandre