I suspect we need to add something like this in google.py. But I cannot test anything at the moment so maybe you can try this?
def filter(self, query, tableobj, prop, op, value): # NDB uses "_key" in stead of "__key__" if prop == "__key__": prop = "_key" return self.GAE_FILTER_OPTIONS[op](query, tableobj, prop, value) On Sunday, November 2, 2014 12:18:50 AM UTC+1, Russ King wrote: > > I have established at least a work-around to this issue by updating > google.py file in adapters and creating a new class to use instead of GAEF > when ndb is being used: > > class GAEFNDB(object): > #This is a work around to belongs not working on id fields when using > ndb > def __init__(self,name,op,value,apply): > self.name=name=='id' and '_key' or name > self.op=op > self.value=value > self.apply=apply > def __repr__(self): > return '(%s %s %s:%s)' % (self.name, self.op, repr(self.value), > type(self.value)) > > and then if the code for belongs is then updated to > > def BELONGS(self,first,second=None): > if not isinstance(second,(list, tuple, set)): > raise SyntaxError("Not supported") > if not self.use_ndb: > if isinstance(second,set): > second = list(second) > if first.type == 'id': > second = [self.keyfunc(first._tablename, int(i)) for i in > second] > if self.use_ndb: > return [GAEFNDB(first.name,'in',second,lambda a,b:a in b)] > return [GAEF(first.name,'in',second,lambda a,b:a in b)] > > it seems to work again - however it's not terribly elegant and it seems to > be totally beyond me to complete the testing process on GAE such that it > could be submitted as a bug-fix. However perhaps someone can review and > advise. > > Cheers > Russ > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.