开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜