[Zope] sort based on a variable

Michael Guerrero mguerrero@tachyon.net
Mon, 17 Mar 2003 14:45:27 -0800

That's exactly what I was looking.

Thank you very much and others that replied as well.

Thanks again.

Mike Guerrero

-----Original Message-----
From: Chris Beaven [mailto:chris@d-designz.co.nz]
Sent: Monday, March 17, 2003 2:27 PM
To: Michael Guerrero
Cc: zope@zope.org
Subject: Re: [Zope] sort based on a variable

I believe your looking for sort_expr
<dtml-in get_list sort_expr=3D"t_sort_order">

Michael Guerrero wrote:

>I have a table tab1 with 3 columns col1,co2,col3.
>I've defined a sql method 'get_list' as 'select col1,co2,col3 from =
>In a dtml method (view_list)I want call get_list and sort on any of the
>three columns.  I know I can do the following:
><dtml-in get_list sort=3D"col2">
>   display stuff here
>I'm passing the sort order column to view_list using -->
>I get no error but incorrect results when I try to do the following in
><dtml-call "REQUEST.set('t_sort_order',sort_order)">
><dtml-in sql_list_rma sort=3Dt_sort_order>
>I also tried putting various combinations of single and double quotes
>around t_sort_order' without any luck.
>I can display t_sort_order, so I know it's getting the proper value.  =
>just doesn't evaluate correctly.  I think it has something with
>double-quotes needing to surround the sort filename.
>I really don't want to create 3 sql methods
>I'd appreciate any help.
>Mike Guerrero
> =20