在dev_appserver上没有索引GQL错误报告属性?

时间:2012-12-21 11:24:09

标签: python google-app-engine google-cloud-datastore gql gqlquery

必须遗漏一些真正愚蠢的东西。这个GQL查询:

q_count = Questions.gql('WHERE questionnaire = :1 AND deleted = False AND required = True', q).count(1000)

生成以下错误: ERROR 2012-12-21 11:19:51,760 _webapp25.py:468] Property 'required' is not indexed

即使我的index.yaml包含以下条目:

- kind: Questions properties: - name: questionnaire - name: deleted - name: required

我错过了什么!

2 个答案:

答案 0 :(得分:2)

现在我感到愚蠢。以下是我Questions模型中“必需”的行:

required = db.BooleanProperty(default=False, indexed=False)

DOH。在日志中引发的PropertyError在GAE文档中定义如下:

exception PropertyError() The referenced model property does not exist on the data object.

答案 1 :(得分:0)

对于仅限等式的查询,您执行not need to define compound indexes