[Zope] sorting a SQL result set

Sion Morris s.morris@bangor.ac.uk
Tue, 3 Jul 2001 09:32:19 +0100


Hi,

I'm sure somebody has done this before and knows the answer :-)

A user can search a MySQL database using an extensive form of over 30 
fields. The result is displayed in a 5 col list with column headings. 
I want to be able to allow sorting (asc and desc) on these columns. 
To sort on any column the query has to be executed again with the 
relevant order clause. As there can be over 30 fields in the original 
query what would be the best way to save and then restore the query?

Does it make sense to try and load the result into a list object 
before displaying and from then on work with the list object when 
sorting?

I hope the above makes sense. Any help greatly appreciated.

Hwyl,

Sion