--- a/pgtoolkit/pgmanager.py Tue Dec 11 11:25:06 2012 +0100
+++ b/pgtoolkit/pgmanager.py Thu Dec 13 16:07:13 2012 +0100
@@ -142,6 +142,9 @@
def keys(self):
return self._dict.keys()
+ def values(self):
+ return self._dict.values()
+
class Cursor(psycopg2.extensions.cursor):
@@ -184,13 +187,13 @@
def adapt(self, row):
if isinstance(row, RowDict):
# dict
- adapted = RowDict()
+ adapted = dict()
for key in row.keys():
adapted[key] = self.mogrify('%s', [row[key]]).decode('utf8')
+ return RowDict(adapted)
else:
# list
- adapted = [self.mogrify('%s', [x]).decode('utf8') for x in row]
- return adapted
+ return [self.mogrify('%s', [x]).decode('utf8') for x in row]
def fetchone_adapted(self, lstrip=None):
'''Like fetchone_dict() but values are quoted for direct inclusion in SQL query.