[Zope] Sorting catalog reports

Chris Fassnacht cfassnacht@ssc.wisc.edu
Thu, 16 Sep 1999 23:19:37 -0500


How do you use the sort attribute in a <dtml-in catalog> statement for a
Zcatalog search report?

I tried using <dtml-in catalog size=50 start=query_start sort=sortkey>,
where sortkey is an input value from a Zcatalog search form that provides
the name of one of the properties to sort on, but I get an AttributeError on
sortkey.

It works fine if I just enter the property name (e.g., id), and I get a true
condition when I try <dtml-if "REQUEST.form.has_key('sortkey')"> and I can
print out the value correctly, so I know the value is making it from the
search form.

This is probably one of those variable formatting syntax gotchas that I (as
a new user) am missing.  It'd be nice if I could find a detailed syntax for
variable expression.  You know, something that tells you when to use _[] or
_[_[]], and what type of quotes (' or ") to use and when.  Does something
like this exist, or is it just Python syntax (meaning I should pick up a
Python book)?

Thanks.

Chris Fassnacht