Fixes ordering with custom db field names

Closes #125
This commit is contained in:
Ross Lawley
2011-05-18 12:18:33 +01:00
parent 1781c4638b
commit 7ba40062d3
2 changed files with 18 additions and 0 deletions

View File

@@ -939,6 +939,10 @@ class QuerySet(object):
if key[0] in ('-', '+'):
key = key[1:]
key = key.replace('__', '.')
try:
key = QuerySet._translate_field_name(self._document, key)
except:
pass
key_list.append((key, direction))
self._ordering = key_list