closed github issue 5, thanks MoMaT
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-05-06 16:00:34) dev
|
Version 1.99.7 (2012-05-06 16:05:07) dev
|
||||||
|
|||||||
+6
-5
@@ -4164,10 +4164,11 @@ class GoogleDatastoreAdapter(NoSQLAdapter):
|
|||||||
def select(self,query,fields,attributes):
|
def select(self,query,fields,attributes):
|
||||||
(items, tablename, fields) = self.select_raw(query,fields,attributes)
|
(items, tablename, fields) = self.select_raw(query,fields,attributes)
|
||||||
# self.db['_lastsql'] = self._select(query,fields,attributes)
|
# self.db['_lastsql'] = self._select(query,fields,attributes)
|
||||||
rows = [
|
rows = []
|
||||||
[t=='id' and (int(item.key().id()) if item.key().id() else
|
for item in items:
|
||||||
item.key().name()) or getattr(item, t) for t in fields]
|
rows.append([
|
||||||
for item in items]
|
t=='id' and item.key().id_or_name() or getattr(item, t) \
|
||||||
|
for t in fields])
|
||||||
colnames = ['%s.%s' % (tablename, t) for t in fields]
|
colnames = ['%s.%s' % (tablename, t) for t in fields]
|
||||||
processor = attributes.get('processor',self.parse)
|
processor = attributes.get('processor',self.parse)
|
||||||
return processor(rows,fields,colnames,False)
|
return processor(rows,fields,colnames,False)
|
||||||
@@ -7178,7 +7179,7 @@ class Table(dict):
|
|||||||
if rows:
|
if rows:
|
||||||
return rows[0]
|
return rows[0]
|
||||||
return None
|
return None
|
||||||
elif str(key).isdigit():
|
elif str(key).isdigit() or isinstance(key, Key):
|
||||||
return self._db(self._id == key).select(limitby=(0,1)).first()
|
return self._db(self._id == key).select(limitby=(0,1)).first()
|
||||||
elif key:
|
elif key:
|
||||||
return dict.__getitem__(self, str(key))
|
return dict.__getitem__(self, str(key))
|
||||||
|
|||||||
Reference in New Issue
Block a user