Ticket #6127: admin-ordering.patch

File admin-ordering.patch, 699 bytes (added by gkelly, 17 years ago)

Admin foreignkey ordering fix

  • django/db/models/query.py

     
    546546                if "." in col_name:
    547547                    table_prefix, col_name = col_name.split('.', 1)
    548548                    table_prefix = qn(table_prefix) + '.'
     549                   if col_name.startswith('-'):
     550                       col_name = col_name[1:]
     551                       order = "DESC"
    549552                else:
    550553                    # Use the database table as a column prefix if it wasn't given,
    551554                    # and if the requested column isn't a custom SELECT.
Back to Top