Commit 6860aeac authored by Alexandre Boeglin's avatar Alexandre Boeglin

Autoselect table to append to column name in 'order_by_expression', if column...

Autoselect table to append to column name in 'order_by_expression', if column is only present in one table.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1438 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 491f24be
...@@ -657,7 +657,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -657,7 +657,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
try: try:
new_sort_index = [] new_sort_index = []
for (k , v) in sort_index: for (k , v) in sort_index:
if query_table: k = query_table + '.' + k if len(acceptable_key_map[key]) == 1 :
k = acceptable_key_map[key][0] + '.' + k
elif query_table:
k = query_table + '.' + k
if v == 'descending' or v == 'reverse': if v == 'descending' or v == 'reverse':
from_table_dict[acceptable_key_map[k][0]] = 1 # We need this table to sort on it from_table_dict[acceptable_key_map[k][0]] = 1 # We need this table to sort on it
new_sort_index += ['%s DESC' % k] new_sort_index += ['%s DESC' % k]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment