#7309: NFA: Don't override order_by if no default ordering is specified
---------------------------------------------+------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone: post-1.0
Component: django.contrib.admin | Version: SVN
Resolution: | Keywords: order_by
nfa-someday
Stage: Design decision needed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by erik):
The problem seems to be that in ChangeList.get_query_set an ordering is
added to the queryset, ignoring an already applied one. This just clears
the previous ordering.
{{{
class QuerySet(object):
...
def order_by(self, *field_names):
"""
Returns a new QuerySet instance with the ordering changed.
"""
assert self.query.can_filter(), \
"Cannot reorder a query once a slice has been taken."
obj = self._clone()
obj.query.clear_ordering()
obj.query.add_ordering(*field_names)
return obj
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/7309#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---