[Zope] Re: RE: [Zope] Grabbing specific indexes from an #in

craigv@jps.net craigv@jps.net
Thu, 22 Jul 1999 11:32:03 -0700


Hope I don't seem dense, but could I get a bit more clarification?

Right now I am iterating through like this:
<!--#in "objectValues('Folder')" sort=sort_code-->

... and pulling out certain properties of each folder:
<!--#var "_['some_property']"-->

How do I achieve the same goal while picking the folder at a specific
sequence? For example, I want to display some properties of the folders
at indexes 2, 5, and 7 without iterating through all of the folders. 

Thanks in advance for your help.

--Craig

> > I am trying to find a way to grab a specific index from an 
> > #in. I would
> > like to use this much like an array in which I could ask for 
> > the object
> > at index [i]. Is there a way to grab specific indexes from an #in
> > without iterating through the entire list of objects?
> > 
> 
> No need to use #in if you just want one item:
> 
> <!--#var "sequence[index]"-->
> 
> you can slice too:
> 
> <!--#in "sequence[5:]"-->
> ...
> <!--#/in-->
> 
> gives you the fifth to the last element.  Note the quotes.  This is an
> evaluation of an expression.
> 
> -Michel
> 
> -Michel
> 
> > Thanks, 
> > 
> > --Craig
> > 
> > 
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://www.zope.org/mailman/listinfo/zope
> > 
> > (For developer-specific issues, use the companion list,
> > zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
> > 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )