[Zope] Object ID and Property confusion

David Salgado David@connmed.co.uk
Wed, 9 Feb 2000 16:40:26 -0000


On Wed, 9 Feb 2000, Jeff K. Hoffman wrote:

>How about this:
>
>  <dtml-in "objectValues('myObj')">
>    <dtml-var sequence-var-id> -- <dtml-var sequence-var-myProp><br>
>  </dtml-in>

I did try an awful lot of variants of this kind of thing, and it works fine
if you're scanning through lists of native objects like Folders, or DTML
Methods. (or at least, the 'id' part works - Folders don't have a 'myProp'
property, of course)

Unfortunately, it doesn't work for ZClass instances -- for some reason, the
id property doesn't get returned in quite the same way from objectValues()
or objectItems(), and you end up with a list like this (which you also get
if you use <dtml-var "_.str(_['sequence-var-id'])">);

<string> -- MyPropValue1<br>
<string> -- MyPropValue2<br>

I have also tried variants of "_.str(id)" and "_.str(id())" -- (the
'sequence-var-' seems to make no difference in this context, except that you
then need to use ugly notation ( _['sequence-var-id'])). This result in
lists like this;

<Python Method object at b8df10> -- MyPropValue1<br>
<Python Method object at b8df10> -- MyPropValue2<br>

But thanks for trying to help, anyway.

             David