finally:
self.driver.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
- def one_(self, statement):
- with self.execute(statement, 2) as cursor:
+ def one_(self, statement, context=None):
+ with self.execute(statement, 2, context) as cursor:
one = cursor.fetchone()
if one == None:
return None
with self.execute(statement, 1) as cursor:
return cursor.fetchall()
- def one(self, statement):
- return self.one_(statement)
+ def one(self, statement, context=None):
+ return self.one_(statement, context)
def has(self, statement):
exists, = self.one_('select exists(%s)' % (statement,))