开发者

Query that only includes objects that don't have a particular element empty - App Engine

开发者 https://www.devze.com 2023-03-05 14:39 出处:网络
Can I make a query that only includes objects that don\'t have a parti开发者_C百科cular element empty in Google App Engine database?

Can I make a query that only includes objects that don't have a parti开发者_C百科cular element empty in Google App Engine database?

Thanks!


non_empty_profile= Profile.all().filter('user !=',None)


It's only possible to filter for property values on entities where that property exists. So if you want entities where name has any value, including None, you can do this:

query.filter('name >=' None)

If you want to fetch all values except None, do this:

query.filter('name >' None)

To fetch all values except an empty string:

query.filter('name !=', '')

0

精彩评论

暂无评论...
验证码 换一张
取 消