[Zope] propertyItems and in

David Kankiewicz kankie@thegrid.net
Sun, 14 Nov 1999 22:49:15 -0800


Jim Washington wrote:
> 
> I get ids only with propertyItems, too.
> 
> To do what you need:
> 
> <dtml-in "propertyIds()[6:32]">
> <dtml-var sequence-item>
> <dtml-var "_.getitem(_['sequence-item'])">
> </dtml-in>

The useful lookup in the ZQR is the 'in' tag.

id:  <dtml-var sequence-key>
value: <dtml-var sequence-item>

will get you the id and value.

> 
> sequence-item has the id, and _.getitem(_['sequence-item']) will get you
> the value of the thing.
> 
> Good luck with your demo.

hope all goes well,
David

> 
> -- Jim Washington
> 
> Oscar Picasso wrote:
> >
> > In the ZQR I read:
> >
> > propertyItems
> > Returns a list of (id, property) tuples.
> >
> > So in a DTML Document I tried:
> > <dtml-in "propertyItems()[6:32]">
> >   <dtml-var sequence-item>
> > </dtml-in>
> >
> > It return the list of the actual properties. I thought that sequence-item
> > would return somthing like:
> > (id, value) so I could access the id with sequence-item[0] and the value
> > with sequence-item[1].
> > Where am I wrong? I need to render both the property id and the property
> > value inside the same <dml-in ...> iteration.
> >
> > Your comments will be greatly appreciated. Monday I have to show a demo of
> > my little Zope application for a more important project. I'm a little
> > nervous...
> >