approach one: make a custom property that converts between ndb and db keys.
this is OK, but db validation will complain when you try to build queries that filter by ndb key. this approach does work in the bare-bones case where you have a db entity handy, and then get the referenced ndb entities via the custom property. (thank goodness for ben ko for asking me to test that!)
approach two: store the urlsafe version of the ndb entity’s key as a db.StringProperty.
this is OK, but annoying in that you have to remember to convert from string to ndb.Key and then get the entity. and do the reverse when you assign.
approach three: rewrite your entire codebase to use ndb.
this is OK, but only if your codebase is two lines. oh ndb.KeyProperty!
is there an approach four that is not a compromise at all?You can leave a response, or trackback from your own site.