date_based.archive_index ordering

0 views
Skip to first unread message

saturdayplace

unread,
Oct 19, 2009, 4:31:09 PM10/19/09
to Django developers
The date_based.archive_index generic view ALWAYS returns a list of
objects ordered by "-date_field", regardless of the queryset it's
been given. I was taken off-guard by this when trying to get the list
to display in a template in "date_field" order. I can get the output
I want by doing {% for obj in list reversed %}, but I think it makes
more sense for the ordering to be determined by the queryset
argument.

By default, querysets are returned in the order determinied by the
ordering option in its Model's meta class, or you can specify the
order with the .order_by() queryset method. Is there a reason for
keeping "-date_field" as the ONLY way to get the list from
archive_index?
Reply all
Reply to author
Forward
0 new messages