escape the field name if the field name is a key word (like 'binary' for exemple)

bzr revid: olt@tinyerp.com-20090212100403-ukaqh4eflhbs9dg0
This commit is contained in:
Olivier Laurent
2009-02-12 11:04:03 +01:00
parent 581f91af08
commit 411778633e
+1 -1
View File
@@ -1922,7 +1922,7 @@ class orm(orm_template):
return "COALESCE(write_date, create_date, now())::timestamp AS %s" % (f,)
return "now()::timestamp AS %s" % (f,)
if isinstance(self._columns[f], fields.binary) and context.get('bin_size', False):
return "length(%s) as %s" % (f,f)
return 'length("%s") as "%s"' % (f, f)
return '"%s"' % (f,)
fields_pre2 = map(convert_field, fields_pre)
for i in range(0, len(ids), cr.IN_MAX):