Changeset 7093
- Timestamp:
- 02/07/08 22:21:21 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/queryset-refactor/django/contrib/admin/views/main.py
r6726 r7093 9 9 from django.shortcuts import get_object_or_404, render_to_response 10 10 from django.db import models 11 from django.db.models.query import handle_legacy_orderlist,QuerySet11 from django.db.models.query import QuerySet 12 12 from django.http import Http404, HttpResponse, HttpResponseRedirect 13 13 from django.utils.html import escape … … 654 654 def get_ordering(self): 655 655 lookup_opts, params = self.lookup_opts, self.params 656 # For ordering, first check the "ordering" parameter in the admin options,657 # then check the object's default ordering. If neither of those exist,658 # order descending by ID by default. Finally, look for manually-specified659 # ordering from the query string.656 # For ordering, first check the "ordering" parameter in the admin 657 # options, then check the object's default ordering. If neither of 658 # those exist, order descending by ID by default. Finally, look for 659 # manually-specified ordering from the query string. 660 660 ordering = lookup_opts.admin.ordering or lookup_opts.ordering or ['-' + lookup_opts.pk.name] 661 662 # Normalize it to new-style ordering.663 ordering = handle_legacy_orderlist(ordering)664 661 665 662 if ordering[0].startswith('-'):
