I want to convert some Entities to new names. How can I query entities not having model class defined.
For example I have such entity (it simplified to be more readable):
class Some(ndb.model):
name = ndb.StringProperty()
I want to rename it to:
class SomeFile(ndb.model):
name = ndb.StringProperty()
How can I do it?
If will rename Some
to SomeFile
there will be no more Some
to query but only data in datastore.
Perhaps I don't understand your question, but is this what you want?:
Although you should make this more efficient by doing it in batches.
You can change your Model class name and have it point to an existing datastore
Kind
by overriding the Model's_get_kind()
method.Now you can use
SomeFile
in python code while retaining theSome
entities in your datastore.https://cloud.google.com/appengine/docs/python/ndb/modelclass#introduction