Critical bug with Python Queries with Equal filters

27 views
Skip to first unread message

Alex Popescu

unread,
Oct 31, 2011, 3:56:05 PM10/31/11
to Google App Engine
Hi all,

I'm wondering if someone else have seen this before and has any ideas
what could lead to this completely confusing behavior


class Content(Model):
uri = db.URLProperty(required=True)
content_type = db.IntegerProperty(required=True, choices=[1, 2, 3,
4, 5,6,7,10, -1])
title = db.StringProperty()

uri=u'http://basho.com/blog/technical/2011/09/19/Riak-Pipe-The-New-Map-
Reduce-Power'
results = Content.all().filter('uri = ', uri).fetch(5)
for c in results:
print "'%s'" % c.uri

=> returns no results

while changing the filter to use greater than:

uri=u'http://basho.com/blog/technical/2011/09/19/Riak-Pipe-The-New-Map-
Reduce-Power'
results = Content.all().filter('uri >= ', uri).fetch(5)
for c in results:
print "'%s'" % c.uri

=> returns:

'http://basho.com/blog/technical/2011/09/19/Riak-Pipe-The-New-Map-
Reduce-Power/'
'http://basho.com/blog/technical/2011/09/19/Riak-Pipe-The-New-Map-
Reduce-Power/'
'http://basho.com/blog/technical/2011/09/19/Riak-Pipe-The-New-Map-
Reduce-Power/'

I've been staring at this code for the last 30 minutes and I cannot
understand what's wrong with it, except maybe some broken internal
index.

Or am I missing something?

Alex Popescu

unread,
Oct 31, 2011, 4:40:12 PM10/31/11
to Google App Engine
This was embarrassing... Please forgive and forget about this post.

Kaan Soral

unread,
Nov 2, 2011, 5:15:59 AM11/2/11
to Google App Engine
is it the space after = :)?
Reply all
Reply to author
Forward
0 new messages