[Zope] sort catalog results w/ table headers ?

Dieter Maurer dieter@handshake.de
Thu, 31 Oct 2002 21:35:19 +0100


Nicolas LAURANCE writes:
 > I would like the headers of the table containing the results of a 
 > catalog query, to be reversable sorting.
 > I'm not sure i'm clear, but just like in the FileLibrary example 
 > given w/ zope 2.5.
 > I studied this example and tried to modify it to suit my need but...
 > As it always starts a new query i get a new results sorted.
You need to pass your old parameters.

You have (at least) two options:

  * you use "GET" requests (which is appropriate for searches).

    Then the parameters to your request are in "QUERY_STRING".

    You may need to strip out your sorting parameters (using 'replace')
    (or use my ":last" path on 
      <http://www.dieter.handshake.de/pyprojects/zope>)
    in order not to get your parameters piled up.

  * you use the "make_query" (or something similar) in
    "ZTUtils" to build your parameters.

For both cases, you can get intuition from a batching example (I
expect, you find some in the Zope Book).


Dieter