From 98706a120c7db0834950638f8061a6d6d5d65619 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 19 Mar 2011 02:13:53 +0000 Subject: [PATCH] Add context argument to sql.one(). --- __init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/__init__.py b/__init__.py index e01c533..7102be6 100644 --- a/__init__.py +++ b/__init__.py @@ -116,8 +116,8 @@ class connect(object): 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 @@ -142,8 +142,8 @@ class connect(object): 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,)) -- 2.45.2