我是一個NDB用戶與該對象的數據庫是很涼爽。但是如何在部署後直接播種特定的默認值?是否有一些預定義的功能或數據庫播種的標準化方法?如何種子谷歌的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()