Just in case this may be of help for someone. When using get_or_insert, the argument is forced to be an string. But when using ndb.Key( ..., THE_ID ), THE_ID can be a number.
The issue was this: PatientDB.get_or_insert( patient_id ) # string SurveyDB( .... parent = ndb.Key( PatientDB, int(patient_id) ) # read note Hence, when looking for surveys: SurveyDB.query( ancestor = a_patient.key ).fetch( ) returns no results. Note: I put int(patient_id) to see the clear effect. In reality, the patient_id was transformed to an int by endpoints API. Datastore Viewer prints the key ids without commas, so it is impossible to see the bug there. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
