Skip to content

Commit

Permalink
send back dejsonized structures
Browse files Browse the repository at this point in the history
  • Loading branch information
James Vasile committed Nov 23, 2011
1 parent b7dad37 commit 5cf2339
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions withsqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ def keys(self):
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:
Expand Down

0 comments on commit 5cf2339

Please sign in to comment.