我是 NDB 用户,这个对象数据库非常酷。但是如何在部署后直接播种特定的默认值?数据库播种是否有一些预定义的功能或标准化方式?
例如:
我有以下ndb.Model并想要某种“现有的默认父级”。
Category(ndb.Model):
name = ndb.StringProperty(required=True)
parent = ndb.KeyProperty(kind='Category',required=True,
default=<KeyOfRootCategory>)
在哪里放置以下种子值?
main_category = Category(name="all", parent=None) #this is the root category
main_category.put()