def convert_local_structured_property(ndb_structured_property, registry=None):
is_required = ndb_structured_property._required
is_repeated = ndb_structured_property._repeated
model = ndb_structured_property._modelclass
name = ndb_structured_property._code_name
def dynamic_type():
_type = registry.get_type_for_model(model)
if not _type:
return None
if is_repeated:
_type = List(_type)
if is_required:
_type = NonNull(_type)
return Field(_type)
field = Dynamic(dynamic_type)
return ConversionResult(name=name, field=field)
评论列表
文章目录