equal
deleted
inserted
replaced
1015 self.free_cnxset(ignoremode=True) |
1015 self.free_cnxset(ignoremode=True) |
1016 self.clear() |
1016 self.clear() |
1017 |
1017 |
1018 # resource accessors ###################################################### |
1018 # resource accessors ###################################################### |
1019 |
1019 |
|
1020 def call_service(self, regid, **kwargs): |
|
1021 self.info('calling service %s', regid) |
|
1022 self.set_cnxset() |
|
1023 try: |
|
1024 service = self.vreg['services'].select(regid, self, **kwargs) |
|
1025 return service.call(**kwargs) |
|
1026 finally: |
|
1027 self.free_cnxset() |
|
1028 |
1020 def system_sql(self, sql, args=None, rollback_on_failure=True): |
1029 def system_sql(self, sql, args=None, rollback_on_failure=True): |
1021 """return a sql cursor on the system database""" |
1030 """return a sql cursor on the system database""" |
1022 if sql.split(None, 1)[0].upper() != 'SELECT': |
1031 if sql.split(None, 1)[0].upper() != 'SELECT': |
1023 self.mode = 'write' |
1032 self.mode = 'write' |
1024 source = self.cnxset.source('system') |
1033 source = self.cnxset.source('system') |
1398 else: |
1407 else: |
1399 self.data[key] = value |
1408 self.data[key] = value |
1400 |
1409 |
1401 # server-side service call ################################################# |
1410 # server-side service call ################################################# |
1402 |
1411 |
1403 def call_service(self, regid, **kwargs): |
1412 call_service = cnx_meth('call_service') |
1404 return self.repo._call_service_with_session(self, regid, |
|
1405 **kwargs) |
|
1406 |
1413 |
1407 # request interface ####################################################### |
1414 # request interface ####################################################### |
1408 |
1415 |
1409 @property |
1416 @property |
1410 def cursor(self): |
1417 def cursor(self): |