Use dictionary to format order clause

This commit is contained in:
Cédric Krier committed 2008-08-23 01:35:25 +02:00
1 parent 4492cd5c90
commit 21ffd7677b
1 file changed
+5 -2
+5 -2
View File
@@ -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