From 5cf233967aba413a9cb8a52120f5291ddcc7f02d Mon Sep 17 00:00:00 2001 From: James Vasile Date: Tue, 22 Nov 2011 19:09:42 -0500 Subject: send back dejsonized structures --- withsqlite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/withsqlite.py b/withsqlite.py index ba44a7e..89ff51a 100644 --- a/withsqlite.py +++ b/withsqlite.py @@ -112,11 +112,11 @@ a.itervalues() return an iterator over the mapping's values def values(self): """a.values() a copy of a's list of values""" self.crsr.execute("select val from store") - return [f[0] for f in self.crsr.fetchall()] + return [json.loads(f[0]) for f in self.crsr.fetchall()] def items(self): """a.items() a copy of a's list of (key, value) pairs""" self.crsr.execute("select * from store") - return self.crsr.fetchall() + return [(f[0], json.loads(f[1])) for f in self.crsr.fetchall()] def get(self, k, x=None): """a.get(k[, x]) a[k] if k in a, else x """ try: -- cgit v1.2.3