access list directly through its index in zope
Hi i have written a python script for ordered folder orderFolder: ------------------------------------------- list=[] for folder in context.objectValues('Folder'): list.insert(folder.getProperty('order'),folder) return list ------------------------------------------- i am able to use it using tal also -------------------------------------------- <table border=1 tal:define="subfolders python:here.orderFolder"> <tr tal:condition="subfolders" tal:repeat="folder subfolders"> <td> <a href="folder" tal:attributes="href python:folder.absolute_url()+'/managesitemap'" tal:content="folder/getId">folder id</a> </td> </tr> </table> --------------------------------------------- but i want to access the subfolders list directly(through its index) like subfolders[0].absolute_url() instead of going through a loop and accessing like folder.absolute_url() Thanks in Advance Ashish
Ashish Thapliyal wrote at 2003-7-24 20:22 +0530:
... i have written a python script for ordered folder ... i am able to use it using tal also
-------------------------------------------- <table border=1 tal:define="subfolders python:here.orderFolder">
<tr tal:condition="subfolders" tal:repeat="folder subfolders"> ... python:folder.absolute_url() ... but i want to access the subfolders list directly(through its index) like subfolders[0].absolute_url() instead of going through a loop and accessing like folder.absolute_url()
Just do it: "python: subfolders[0].absolute_url()" Dieter
participants (2)
-
Ashish Thapliyal -
Dieter Maurer