NDB accepts set, list and tuple, thanks Quint
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.7.4-stable+timestamp.2013.11.18.15.40.40
|
Version 2.7.4-stable+timestamp.2013.11.19.17.05.52
|
||||||
|
|||||||
+4
-3
@@ -4949,9 +4949,10 @@ class GoogleDatastoreAdapter(NoSQLAdapter):
|
|||||||
def BELONGS(self,first,second=None):
|
def BELONGS(self,first,second=None):
|
||||||
if not isinstance(second,(list, tuple, set)):
|
if not isinstance(second,(list, tuple, set)):
|
||||||
raise SyntaxError("Not supported")
|
raise SyntaxError("Not supported")
|
||||||
if first.type != 'id':
|
if not self.use_ndb:
|
||||||
return [GAEF(first.name,'in',self.represent(second,first.type),lambda a,b:a in b)]
|
if isinstance(second,set):
|
||||||
else:
|
second = list(second)
|
||||||
|
if first.type == 'id':
|
||||||
second = [Key.from_path(first._tablename, int(i)) for i in second]
|
second = [Key.from_path(first._tablename, int(i)) for i in second]
|
||||||
return [GAEF(first.name,'in',second,lambda a,b:a in b)]
|
return [GAEF(first.name,'in',second,lambda a,b:a in b)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user