문제

Must be missing something really dumb here. This GQL query:

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

generated following error: ERROR 2012-12-21 11:19:51,760 _webapp25.py:468] Property 'required' is not indexed

Even though my index.yaml contains the following entry:

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

What am I missing!

도움이 되었습니까?

해결책

Now I feel stupid. Here is the line for 'required' in my Questions model:

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

doh. The PropertyError which was raised in the log is defined as follows in GAE docs:

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

다른 팁

For equality-only queries you do not need to define compound indexes.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top