Commits

Anonymous committed 709d527

magic-removal: Fixed #1685 -- order_by no longer breaks when using a custom 'select'. Thanks, feiyu.xie

  • Participants
  • Parent commits 6578e35
  • Branches magic-removal

Comments (0)

Files changed (1)

django/db/models/query.py

                 else:
                     # Use the database table as a column prefix if it wasn't given,
                     # and if the requested column isn't a custom SELECT.
-                    if "." not in col_name and col_name not in [k[0] for k in (self._select or ())]:
+                    if "." not in col_name and col_name not in (self._select or ()):
                         table_prefix = backend.quote_name(opts.db_table) + '.'
                     else:
                         table_prefix = ''