Gist 1127779
✓ Published0🌍 Public
Aandrewxhill
Last edited Aug 5, 2011
Created on Aug 5, 2011
This example demonstrates a data-modeling pattern for the App Engine datastore using Python and the db.Model API. It shows how to structure a `Note` entity with a `ReferenceProperty` to a `Cell` entity, enabling reverse lookup of all notes attached to a cell via `Cell.notes`. The code also illustrates an alternative approach using parent-child relationships, where `Note.parent()` returns the owning `Cell`. Finally, it suggests constructing cell keys as composite strings like `'z/x/y/year/month/day'` to support efficient searches by coordinates and time.
AI-generated description