Hi Sergey, This is a known and expected behavior, it is mentioned in the docs: http://code.google.com/appengine/docs/python/datastore/queryclass.html#Query_filter
Datastore property names don't have to be valid Python identifiers. When there is no space in the filter def, equality is assumed. I do agree that this is an easy mistake to make. But, I know I've got lots of filters in my code that omit the operator for brevity. And who knows, someone probably also has an "=" in a property name. Robert On Thu, Jun 23, 2011 at 04:50, sergey <[email protected]> wrote: > Hi all! > I have spend more my time to find bug in my code, source of which is a > feature of the filtering methods: > Сompare the two codes and try to quickly find a mistake in one of them > (which you do not show any IDE): > > code 1: > > from google.appengine.ext import db > class Item(db.Model): > name = db.StringProperty() > > Item(name= 'ipad').put() > ipads = Item.all().filter('name =', 'ipad').count() > > print ipads > > code 2: > > from google.appengine.ext import db > class Item(db.Model): > name = db.StringProperty() > > Item(name= 'ipad').put() > ipads = Item.all().filter('name=', 'ipad').count() > > print ipads > > > what the code is correct? > > i think you need to to fix this feature in future releases > > p.s. filter('name=', 'ipad') != filter('name =', 'ipad') > > -- > 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.
