[Zope] Object ID and Property confusion
James W. Howe
jwh@allencreek.com
Wed, 09 Feb 2000 12:21:09 -0500
At 04:40 PM 2/9/00 +0000, David Salgado wrote:
>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>
Hmm. My suggestion (using <dtml-var id>) worked fine on my system when I
searched for instances of ZClasses contained in a Folder. I wonder what's
different? Maybe it depends on what base classes are used for the ZClass.
James W. Howe mailto:jwh@allencreek.com
Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103