from Utils.ObjUtil import SpecObject from Utils.ValidateUtil import ValidateAttr, Validate class FileObj(SpecObject): """对象文件""" class Parameter(SpecObject): """对象参数""" chinese = ValidateAttr(field="chinese", type=str) name = ValidateAttr(field="name", type=str) types = ValidateAttr(field="types", type=[str, classmethod]) length = ValidateAttr(field='length', type=int) instance_list = ValidateAttr(field="instance_list", type=classmethod) in_list = ValidateAttr(field="in_list", type=list) fields_map = { "chinese": "字段中文名", "name": "字段名称", "types": "类型", "length": "长度", "instance_list": "列表类名", "in_list": "列表数据", } class_name = ValidateAttr(field="class_name", type=str) parameter = ValidateAttr(field="parameter", instance_list=Parameter) fields_map = { "class_name": "类名", "parameter": "参数" }