First off you should have spaces between the name and the operator in the
query string.
However that won't solve you problem in this case in the code of
datastore.Query you will see the following docs
> query = Query('Person')
> query.update({'name =': 'Ryan', 'age >=': 21})
The supported operators are =, >, <, >=, and <=. Only one inequality
filter may be used per query. Any number of equals filters may be used in
a single Query.
With a bit of further digging in appengine.datastore.datastore_query you
can see the set of _INEQUALITY_OPERATORS and != is not one of them
So you will need to rethink what you are doing.
T
On Wednesday, October 9, 2013 9:32:03 PM UTC+8, Mitul Golakiya wrote:
>
> Hello All,
>
> We are developing one app on GAE with python.
>
> We are using datastore.py for querying data from datastore, because we
> have to define our entities at runtime. So we can not use db.Model to
> define models. And retrieve data by models.
>
> We have to use "Not Equal" operator to retrieve some data from datastore.
> Suppose, I want to retrieve all Persons, with name is not equal to "Test".
>
> Here is my code :
>
> filerObj = {}
>> filterObj["name!="] = "Test"
>>
>> dbObj = datastore.Query("Person", filterObj)
>> dbObj.Run()
>> recordsList = dbObj.Get()
>>
>
>
> By this code, we are getting empty result.
> Any idea about what's wrong ??
>
> Thanks in Advance...
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.