Filter with string return nothing
I am facing a problem. Did I miss something?
Association.all().count()
1
Association.all().fetch(1)
[Association(**{'server_url': u'server-url', 'handle': u'handle2', 'secret': 'c2VjcmV0\n', 'issued': 1242892477L, 'lifetime': 200L, 'assoc_type': u'HMAC-SHA1'})]
Association.all().filter('server_url =', 'server-url').count()
0 # expect 1
Association.all().filter('server_url =', u'server-url').count()
0 # expect 1
Association.all().filter('issued >', 0).count()
1
0
a source to share
1 answer
Which property is "server_url"?
If it is a TextProperty, then it cannot be used in filters.
Unlike StringProperty, TextProperty value can be more than 500 bytes. However, TextProperty values ββare not indexable and cannot be used in filters or sort order.
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#TextProperty
+5
a source to share