Is there a good way (any way) to hook a db.Model subclass so that it
does some magic right before being written to the Datastore, and some
reverse magic right when it's read back?

E.g. Say you want to have a big JSON object stored in a TextProperty.
Obviously you could JSON and de-JSON it yourself every time you load
or save it.  But ideally you could hook this code into the class
itself, so as soon as it's read from the store the JSON string is gone
and a Python object is in its place.  Similarly, you could manipulate
the Python object and write it back to the store, where it would be
quickly re-JSONed prior to hitting BigTable.

Or maybe there's another better way to work with and serialize
arbitrary Python data (lists, dicts, etc.) without writing the code
for it in multiple places... Pickle?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to