]> git.saurik.com Git - cyql.git/commitdiff
Add context argument to sql.one().
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Mar 2011 02:13:53 +0000 (02:13 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Mar 2011 02:14:01 +0000 (02:14 +0000)
__init__.py

index e01c53361ebf699834ba4090a74c957e0f77e0d7..7102be6fd9e3ab884277e48d73a6376e859c8dc6 100644 (file)
@@ -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,))