Fix _timestamp for table_query

This commit is contained in:
Cédric Krier
2008-09-08 12:46:06 +02:00
parent e5c57a8d5f
commit 8ce07db532
+6 -3
View File
@@ -1023,9 +1023,12 @@ class ORM(object):
or '"' + x + '"' for x in fields_pre \
if x != '_timestamp']
if '_timestamp' in fields_pre:
fields_pre2 += ['(CASE WHEN write_date IS NOT NULL ' \
'THEN write_date ELSE create_date END) ' \
'AS _timestamp']
if not self.table_query(context):
fields_pre2 += ['(CASE WHEN write_date IS NOT NULL ' \
'THEN write_date ELSE create_date END) ' \
'AS _timestamp']
else:
fields_pre2 += ['now()::timestamp AS _timestamp']
for i in range(0, len(ids), cursor.IN_MAX):
sub_ids = ids[i:i + cursor.IN_MAX]
if domain1: