Let's say I have a model with school, cool, student models. In this model, classes are children of the school, and students are children of the class. I would like to get all the students grouped by their class.
Using NDB, I can get call students for school A with:
school_key = ndb.Key( 'School', 'A' )
all_students_in_A = Student.query( ancestor = school_key ).fetch( )
However, I would like to get students in groups A by class. Looking at the document, the request accepts the group_by argument, but only for real model fields.
source
share