from Utils.ObjUtil import SpecObject from Utils.ValidateUtil import ValidateAttr, Validate class ExecutiveList(SpecObject): """高管列表""" pid = ValidateAttr(field='pid', type=str, default=None) name = ValidateAttr(field='name', type=str) duties = ValidateAttr(field='duties', type=[list, str]) fields_map = { "pid": "人物ID", "name": "姓名", "duties": "职务" } class ExecutiveObj(SpecObject): """高管信息""" cid = ValidateAttr(field='cid', type=str, length=8) cname = ValidateAttr(field='cname', type=str) executive_list = ValidateAttr(field='executive_list', instance_list=ExecutiveList) update_time = ValidateAttr(field='update_time', func=Validate.time_format) fields_map = { "cid": "企业ID", "cname": "企业名称", "executive_list": "高管列表", "update_time": "更新时间" }