The good news is, you donβt need to make any changes to your saved data, but ext.db and ndb read and write accurate data.
Here is a quote from the Nit Cheat Sheet :
No changes to the data warehouse required
If you were wondering, despite the various APIs, NDB and the old ext.db package write exactly the same data to Datastore. This means that you donβt need to do any conversion to the data warehouse, and you can happily mix and match NDB and ext.db code if the scheme you use is equivalent. You can even convert between ext.db and NDB keys with ndb.Key.from_old_key () and key.to_old_key () .
The cheat sheet is a great guide to translate your model definitions. For example, modifying MailMessageModel should be as simple as:
before:
class MailMessage(db.Model): m_text = db.TextProperty() m_from = db.ReferenceProperty(reference_class=UserModel) m_to = db.ReferenceProperty(reference_class=UserModel)
after
class MailMessage(ndb.Model): m_text = ndb.TextProperty() m_from = ndb.KeyProperty(kind=UserModel) m_to = ndb.KeyProperty(kind=UserModel)
I highly recommend using a cheat sheet to help you with your migration.
Sean lynch
source share