I have a model like this:
class Group(db.Model):
name = db.StringProperty()
description = db.TextProperty()
Sometimes when executing queries like:
groups = Group.all().order("name").fetch(20)
or
groups = Group.all()
I'm getting error massages like this:
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'
But when I'm using GQL queries with the same meaning, everything goes fine.
Why does that happens? I'm don't getting why GAE thinks that 'all' is attribute?
UPDATE: Oops ... I've found out that I also had request handler named the same as model ;(