fix wrapped query set ordering
This commit is contained in:
parent
c50f74e02e
commit
548f442e81
1 changed files with 2 additions and 1 deletions
|
@ -903,13 +903,14 @@ class QuerySetWrapper(BaseQueryWrapper):
|
|||
field = field.lstrip('-')
|
||||
val = getattr(obj, field.lstrip('-'))
|
||||
if field in ('id', 'pk'):
|
||||
if isinstance(field, int):
|
||||
if isinstance(val, int):
|
||||
result.extend((1*fact, val*fact))
|
||||
else:
|
||||
result.extend((2*fact, int(val[1:])*fact))
|
||||
else:
|
||||
result.append(val * fact)
|
||||
return tuple(result)
|
||||
return key_func
|
||||
|
||||
def _get_cached_result(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue