私はこのようなモデルを持っています:
class Group(db.Model):
name = db.StringProperty()
description = db.TextProperty()
次のようなクエリを実行する場合があります。
groups = Group.all().order("name").fetch(20)
また
groups = Group.all()
次のようなエラー メッセージが表示されます。
Traceback (most recent call last):
File "/opt/google_appengine/google/appengine/ext/webapp/__init__.py", line 501, in __call__
handler.get(*groups)
File "/home/al/Desktop/p/mwr-dev/main.py", line 638, in get
groups = Group.all()
AttributeError: type object 'Group' has no attribute 'all'
しかし、同じ意味で GQL クエリを使用している場合は、すべてうまくいきます。
なぜそれが起こるのですか?GAE が「すべて」が属性であると考える理由がわかりません。
更新:おっと...モデルと同じ名前のリクエストハンドラーもあることがわかりました;(