带字符串的筛选器不返回任何内容

2024-06-16 11:36:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我遇到了跟车问题。我错过什么了吗?在

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

Tags: urlsecretservercountfetchallfilterexpect
1条回答
网友
1楼 · 发布于 2024-06-16 11:36:54

“服务器url”是什么属性?在

如果它是TextProperty,则不能在筛选器中使用。在

Unlike StringProperty, a TextProperty value can be more than 500 bytes long. However, TextProperty values are not indexed, and cannot be used in filters or sort orders.

http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#TextProperty

相关问题 更多 >