92 |
92 |
93 def etype_class(self, etype): |
93 def etype_class(self, etype): |
94 """return an entity class for the given entity type""" |
94 """return an entity class for the given entity type""" |
95 return self.vreg.etype_class(etype) |
95 return self.vreg.etype_class(etype) |
96 |
96 |
97 def system_sql(self, sql, args=None): |
97 def system_sql(self, sql, args=None, rollback_on_failure=True): |
98 """return a sql cursor on the system database""" |
98 """return a sql cursor on the system database""" |
99 if not sql.split(None, 1)[0].upper() == 'SELECT': |
99 if not sql.split(None, 1)[0].upper() == 'SELECT': |
100 self.mode = 'write' |
100 self.mode = 'write' |
101 return self.pool.source('system').doexec(self, sql, args) |
101 return self.pool.source('system').doexec(self, sql, args, |
|
102 rollback=rollback_on_failure) |
102 |
103 |
103 def set_language(self, language): |
104 def set_language(self, language): |
104 """i18n configuration for translation""" |
105 """i18n configuration for translation""" |
105 vreg = self.vreg |
106 vreg = self.vreg |
106 language = language or self.user.property_value('ui.language') |
107 language = language or self.user.property_value('ui.language') |