I have an idea for a new tag
When rendering dictionary, there is absolutely no way to display
values sorted by keys. The only workaround is to copy all the dict
items to a sortable structure e.g. list and pass the list to the
template, instead of the dictionary.
Why not introduce a new tag to solve this problem:
I say, it should be called {%secretfor%} and the usage would be
{%secretfor k,v in mydict %}
... do stuff....
{%endsecretfor%}
would work like sorted(mydict.keys)
I won't stick with the tag name, but you see my point.
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home