App Engine StringListProperty.
-
14-09-2020 - |
题
我有一个如下所示的模型:
class test (db.Model) :
tagList = StringListProperty()
siteName = StringProperty()
.
我将标签存储在“ticllist”中,并希望运行一个查询,其中我可以在其标记列表中获取包含特定标记的所有测试实体。
这可能吗?
解决方案
只使用平等运算符。
q = test.all()
q.filter("tagList =", "some_tag")
q.fetch()
.
对于列表属性,App Engine将“等于”作为“包含”。
不隶属于 StackOverflow