Revision 5641
Added by Aaron Marcuse-Kubitza about 12 years ago
lib/sql.py | ||
---|---|---|
716 | 716 |
assert start == None or isinstance(start, (int, long)) |
717 | 717 |
if limit == 0: order_by = None |
718 | 718 |
if order_by is order_by_pkey: |
719 |
order_by = None
|
|
720 |
if table0 != None and distinct_on == []:
|
|
721 |
order_by = table_order_by(db, table0, recover=True)
|
|
719 |
if lists.is_seq(distinct_on) and distinct_on: order_by = distinct_on[0]
|
|
720 |
elif table0 != None: order_by = table_order_by(db, table0, recover=True)
|
|
721 |
else: order_by = None
|
|
722 | 722 |
|
723 | 723 |
query = 'SELECT' |
724 | 724 |
|
Also available in: Unified diff
sql.py: mk_select(): order_by defaults to first distinct_on column when distinct_on provided