GAE ancestor query without ancestor in the results

Ancestor queries in GAE can return the ancestor in the results: when ancestor and query kind are the same, eg.: SomeModel.query(ancestor=some_key) on kindless query, eg.: ndb.Query(ancestor=some_key) To filter out ancestor instance from being fetched use filter on __key__: SomeModel.query(ancestor=some_key).filter(SomeModel.key > some_key)

JSON serialization of Google App Engine models

For some AJAX requests you’ll need an rpc urls returning a serialized objects. In principle its simple just use JSON serialization build in in Django or simplejson module itself. Here are sample view methods: def entity_list(request, entity_key=None): user = users.get_current_user().email().lower(); col = models.Entity.gql(’WHERE user=:1′,user).fetch(300, 0) json = serializers.serialize(„json”, col) return …

Back to Top