Use dictionary to format order clause
This commit is contained in:
1 parent
4492cd5c90
commit
21ffd7677b
1 file changed
+5
-2
+5
-2
@@ -2519,8 +2519,11 @@ class ORM(object):
|
||||
return order_by, tables, clause
|
||||
|
||||
if field_name:
|
||||
if '%s' in field_name:
|
||||
order_by.append(field_name % table_name + ' ' + otype)
|
||||
if '%(table)s' in field_name or '%(order)s' in field_name:
|
||||
order_by.append(field_name % {
|
||||
'table': table_name,
|
||||
'order': otype,
|
||||
})
|
||||
else:
|
||||
order_by.append(table_name + '.' + field_name + ' ' + otype)
|
||||
return order_by, tables, clause
|
||||
|
||||
Reference in new issue
Block a user