Hey Ajaxer,
Yes, GQL has an IN operator. You can use it via GqlQuery or the Query object.
http://code.google.com/appengine/docs/python/datastore/gqlreference.html
http://code.google.com/appengine/docs/python/datastore/queryclass.html
>From the docs:
Note: The IN and != operators use multiple queries behind the scenes.
For example, the IN operator executes a separate underlying datastore
query for every item in the list. The entities returned are a result
of the cross-product of all the underlying datastore queries and are
de-duplicated. A maximum of 30 datastore queries are allowed for any
single GQL query.
Robert
On Tue, Nov 9, 2010 at 23:42, ajaxer <[email protected]> wrote:
> thanks.
>
> there is no 'or' in gql?
>
> records = QMessage.gql('where time > :1 and room = :2 and fromUser
> = :3 or toUser = :3 order by time limit', time, room, user)
>
>
> BadQueryError: Parse Error: Expected no additional symbols at symbol
> or
>
> On Nov 10, 1:01 am, Robert Kluin <[email protected]> wrote:
>> http://code.google.com/appengine/docs/python/datastore/queriesandinde...
>>
>> I am just guessing about your application, but I would drop the user
>> filter from the query and handle it in your app code. Or you can run
>> two queries and merge the results yourself.
>>
>> Robert
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Nov 9, 2010 at 11:39, ajaxer <[email protected]> wrote:
>> > BadFilterError: BadFilterError: invalid filter: Only one property per
>> > query may have inequality filters (<=, >=, <, >)..
>>
>> > my code:
>>
>> > records = QMessage.all().filter('room = ', room).filter('isPrivate
>> > =',
>> > False).filter('fromUser !=', user).filter('time > ', time)
>>
>> > how can i solve this problem?
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "Google App Engine" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group
>> > athttp://groups.google.com/group/google-appengine?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.