Hi djangonauts,

I'd like an advice on the following problem: I try to display a sorted list in 
a template, according to GET parameters. I'd like to use the 'dictsort' 
filter and the 'reversed' keyword, since I'd like to sort on values created 
in the view, which are not present in DB.

Currently, I have:
{% for l in list|dictsort:"name" %}
...
{% endfor %}

I can replace "name" by a variable, but I'd also like to replace 'reversed' by 
a variable, to be able to control the sort order from the GET payload.

Is there a way to achieve this? Or another mean to control sort fields and 
order from GET for a list?

In a more general way, it would be very convenient to be able to pass 
parameters to templates blocks, and to have sort of templates functions: I 
often use the same HTML blocks with a slight parameter changing (like class 
attribute), and I currently have to duplicate these redundant blocks. Which 
seems quite frustrating for a DRY framework. :)

Thanks in advance,
-- 
Kilian CAVALOTTI                      Administrateur réseaux et systèmes
UPMC / CNRS - LIP6 (C870)
8, rue du Capitaine Scott                          Tel. : 01 44 27 88 54
75015 Paris - France                               Fax. : 01 44 27 70 00

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to