python - Need Pattern for lookup tables in Google App Engine -


I am using Python version of Google App Engine and Datastore. What is a good way to load a table that contains lookup data?

After viewing the data, I mean that there will be no need to insert, remove, or update any rows after the initial load.

All the rows off and the table reloadable if acceptable It does not destroy referential integrity with mentioning it in other rows.

Here is an example of a pair type that I am using that I want to load data into.

 square badges (DB model): name = db .StringProperty () level = db.IntegerProperty () Class Achievement (DB Model): name = db.StringProperty () level = db.IntegerProperty () badge = db.ReferenceProperty (reference_class = badge)  

Here is an example of not looking for data but it is an example of

 class CamperAchievement (db.Model): tourist = db.ReferenceProperty (reference_class = camper) achievement = db.ReferenceProperty (reference_ Class = Achievement) session = db.ReferenceProperty (reference_class = session) passed = db.BooleanProperty (default = true)  

I'm looking for two things to explore: what data to load Should look like code for?
Should the loading code trigger to execute?

After

If it was actually created once and never changes within the lifetime of a deployment , And it's relatively small (some megs or less), store data from your app as files. The app initially loaded the data in memory, and cache it there.

Comments