Fixed order-then-filter issue

This commit is contained in:
Harry Marr
2010-11-01 00:43:30 +00:00
parent e868f37c60
commit 6b880aa8b3
2 changed files with 21 additions and 1 deletions

View File

@@ -431,7 +431,9 @@ class QuerySet(object):
self._cursor_obj.where(self._where_clause)
# apply default ordering
if self._document._meta['ordering']:
if self._ordering:
self._cursor_obj.sort(self._ordering)
elif self._document._meta['ordering']:
self.order_by(*self._document._meta['ordering'])
if self._limit is not None: