我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用google.appengine.ext.ndb.StructuredProperty()。
def convert_StructuredProperty(self, model, prop, kwargs): """Returns a form field for a ``ndb.StructuredProperty``.""" return None
def __init__(self, model_type, ancestor_type=None, keep_history=True): self.model_type = model_type self.ancestor_type = ancestor_type self.model_name = model_type.__name__ self.keep_history = keep_history if self.keep_history: history_props = { 'date': ndb.DateTimeProperty(auto_now_add=True), 'obj': ndb.StructuredProperty(model_type, repeated=False), 'client_id': ndb.StringProperty(), } self.history_model = type( self.model_name + 'History', (ndb.Model,), history_props)