dbapi.py
changeset 4850 bd640b137f50
parent 4768 430b89aed996
child 4895 7003912cec86
equal deleted inserted replaced
4849:3827b9ee77ac 4850:bd640b137f50
   200         except KeyError:
   200         except KeyError:
   201             # this occurs usually during test execution
   201             # this occurs usually during test execution
   202             self._ = self.__ = unicode
   202             self._ = self.__ = unicode
   203             self.pgettext = lambda x, y: y
   203             self.pgettext = lambda x, y: y
   204         self.debug('request default language: %s', self.lang)
   204         self.debug('request default language: %s', self.lang)
   205 
       
   206     def decorate_rset(self, rset):
       
   207         rset.vreg = self.vreg
       
   208         rset.req = self
       
   209         return rset
       
   210 
   205 
   211     def describe(self, eid):
   206     def describe(self, eid):
   212         """return a tuple (type, sourceuri, extid) for the entity with id <eid>"""
   207         """return a tuple (type, sourceuri, extid) for the entity with id <eid>"""
   213         return self.cnx.describe(eid)
   208         return self.cnx.describe(eid)
   214 
   209 
   657         depreciated: executemany() should be used instead.
   652         depreciated: executemany() should be used instead.
   658 
   653 
   659         Return values are not defined by the DB-API, but this here it returns a
   654         Return values are not defined by the DB-API, but this here it returns a
   660         ResultSet object.
   655         ResultSet object.
   661         """
   656         """
   662         self._res = res = self._repo.execute(self._sessid, operation,
   657         self._res = rset = self._repo.execute(self._sessid, operation,
   663                                              parameters, eid_key, build_descr)
   658                                               parameters, eid_key, build_descr)
   664         self.req.decorate_rset(res)
   659         rset.req = self.req
   665         self._index = 0
   660         self._index = 0
   666         return res
   661         return rset
   667 
   662 
   668 
   663 
   669     def executemany(self, operation, seq_of_parameters):
   664     def executemany(self, operation, seq_of_parameters):
   670         """Prepare a database operation (query or command) and then execute it
   665         """Prepare a database operation (query or command) and then execute it
   671         against all parameter sequences or mappings found in the sequence
   666         against all parameter sequences or mappings found in the sequence