Your Session class overrides Model.__init__? It has an "intentionally undocumented" parameter _from_entity. When doing things like overriding __init__, consider adding **kwargs, passing it on to the super-class' constructor.
Hugo On Apr 27, 12:10 am, Ralfeus <ralf...@gmail.com> wrote: > Hi, everyone > I'm trying to get an entity by its key. I have a class Session derived > from db.Model > Trying such code: > Session.get('agd0ZXN0YXBwcg0LEgdTZXNzaW9uGBkM') > I get the error: > Traceback (most recent call last): > File "/var/www/google_appengine/google/appengine/ext/admin/ > __init__.py", line 218, in post > exec(compiled_code, globals()) > File "<string>", line 7, in <module> > File "/var/www/google_appengine/google/appengine/ext/db/ > __init__.py", line 992, in get > results = get(keys, rpc=rpc) > File "/var/www/google_appengine/google/appengine/ext/db/ > __init__.py", line 1255, in get > model = cls1.from_entity(entity) > File "/var/www/google_appengine/google/appengine/ext/db/ > __init__.py", line 1179, in from_entity > instance = cls(None, _from_entity=True, **entity_values) > TypeError: __init__() got an unexpected keyword argument > '_from_entity' > > I tried Session.get(Key('agd0ZXN0YXBwcg0LEgdTZXNzaW9uGBkM')) > Also I tried Session.gql("where __key__ = :1", > db.Key('agd0ZXN0YXBwcg0LEgdTZXNzaW9uGBkM')).get() > The error remains same in all cases. > > Is it bug? Or I miss something? > Thank you in advance > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appeng...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-appengine?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.