[Erp5-dev] listbox - sort by formatted column

Jérôme Perrin jerome at nexedi.com
Thu Jan 25 19:10:29 CET 2007


Le Mercredi 24 Janvier 2007 23:20, bartek a écrit :
> Hello
>
> What's The Right Way to display a formatted data (e.g. date) in a
> listbox column and at the same time allow sorting by it?
>
> The best solution I could come up with was putting a script like
> Base_formatCreationDate(brain, selection)
> as a listbox column and then processing kw['sort_on'] in the listboxes
> List Method to replace ('Base_formatCreationDate', 'ascending') with
> ('creation_date', 'ascending').

Use an editable field listbox_creation_date, sorting and searching will then 
use creation_date.
If you want to display a custom value, the brain for the current line is 
"cell" in TALES context.

Jérome



More information about the Erp5-dev mailing list