Re: [Zope] sorting based on object url
14 Mar
2001
14 Mar
'01
8:13 p.m.
Parikh, Jay writes:
I have a simple ZCatalog that I am trying to sort via the path of the objects. I have the following so far, and it doesn't seem to work.
<dtml-in catalog sort="catalog.getpath(data_record_id_)" size=50 start=query_start> With Zope 2.3, you can use "sort=getpath".
I fear, it is much more difficult with older Zope versions. The "sort_expr" is evaluated just once at the start of the sort to get a sort specification for the complete sort. It is not evaluated in the context of each element, thus, it can not use the elements attributes (such as "data_record_id_". You can use a Python Script (or external method) that returns "catalog.getpath(data_record_id_)" and use that as sort criterion. Dieter
9155
Age (days ago)
9155
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dieter Maurer