gpt4 book ai didi

python - 谷歌应用引擎: empty property in datastore

转载 作者:行者123 更新时间:2023-12-01 06:16:50 24 4
gpt4 key购买 nike

假设我有一个模型:

class A(db.Model):
B = db.StringProperty()
C = db.StringProperty()

如果我想使用 python 搜索 C 中的所有空属性(不是无,只是空),如何查询?

最佳答案

来自GAE Python documents

It is not possible to perform a query for entities that are missing a given property. One alternative is to create a fixed (modeled) property with a default value of None, then create a filter for entities with None as the property value.

关于python - 谷歌应用引擎: empty property in datastore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2842661/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com