the dot in table.field is important because in django.db.models.sql.compiler, there is:
for field in ordering:
# ....
if '.' in field:
# This came in through an extra(order_by=...) addition. Pass it
# on verbatim.
table, col = col.split('.', 1)
if (table, col) not in processed_pairs:
elt = '%s.%s' % (qn(table), col)
processed_pairs.add((table, col))
if not distinct or elt in select_aliases:
result.append('%s %s' % (elt, order))
group_by.append((elt, []))
Comments
#
Hei - why im getting this error?
hope u have an idea
#
For django 1.2, small patch to apply:
#
Don't mind my previous comment, this just fixes the error but does not order by NULLS LAST.
Workaround: after building your queryset, do:
the dot in table.field is important because in django.db.models.sql.compiler, there is:
bit of a hack...
#