开发者

Using GQL to check if BlobProperty is NULL

开发者 https://www.devze.com 2022-12-27 03:43 出处:网络
I have a db.BlobProperty property (c开发者_如何学Called \"Icon\") in my entity which contains an image binary. I want to run a GQL query to retrieve all entities with an image (i.e. their \"Icon\" pro

I have a db.BlobProperty property (c开发者_如何学Called "Icon") in my entity which contains an image binary. I want to run a GQL query to retrieve all entities with an image (i.e. their "Icon" property is not NULL).

Trying to use the following query:

"SELECT * FROM Names WHERE Icon!=NULL"

did not work... Trying to use .filter("Icon!=",None) did not work as well...

Any ideas?

Thanks!

Joel


You can't filter on blob properties - they're not indexed. Your best option is to add an indexed boolean property, which indicates if the blob is present or not.

0

精彩评论

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