Ticket #930: 930_patch.diff

File 930_patch.diff, 1.1 KB (added by django@…, 18 years ago)
  • C:/Program

     
    15971597    where = kwargs.get('where') and kwargs['where'][:] or []
    15981598    params = kwargs.get('params') and kwargs['params'][:] or []
    15991599
     1600    #Add tables for columns in order clause and table not in tables list
     1601    order_by_tables = []
     1602    for f in handle_legacy_orderlist(kwargs.get('order_by', opts.ordering)):
     1603        if f == '?':
     1604            continue
     1605        if f.startswith('-'):
     1606            f = f[1:]
     1607        if "." in f:
     1608            table = f.split('.')[0]
     1609            table = db.db.quote_name(table)
     1610            order_by_tables.append(table)
     1611    tables.extend(order_by_tables)
     1612
    16001613    # Convert the kwargs into SQL.
    16011614    tables2, join_where2, where2, params2, _ = _parse_lookup(kwargs.items(), opts)
    16021615    tables.extend(tables2)
Back to Top