The Query interface of the DAL API is going to be changed in next version to make it compatible with Google App Engine as GAE doesn't support
OR operator. However,
the IN operator can provide limited OR support.
Also the
Query.filter would be changed to follow GAE's Query.filter
signature. The OR and NOT IN operators are not supported in GAE, but the
DAL API would implement support for these operators.
So, the following syntax:
Query(User).filter('name = :name and age >= :age', name='some', age=18)
Query(User).filter('name =', 'some').filter('age >=', 18)
from kalapy.db import Query, Q
Query(User).filter(Q('name =', 'some') || Q('age >=', 18))
NOT IN would be expanded to (only GAE):
Query(User).filter('name not in', ['some', 'thing', 'else'])
# to
Query(User).filter('name !=', 'some') \
.filter('name !=', 'thing') \
.filter('name !=', 'else')
Stay Tuned!
0 comments:
Post a Comment