diff --git a/exceltpl/pdman/pdman_reader.py b/exceltpl/pdman/pdman_reader.py index a82ecf4..7ae3237 100644 --- a/exceltpl/pdman/pdman_reader.py +++ b/exceltpl/pdman/pdman_reader.py @@ -97,7 +97,7 @@ class PDmanReader(object): def _fields_convert(self, fields): rt = [] for f in fields: - if len(f['domain']) > 0: + if 'domain' in f.keys() and len(f['domain']) > 0: f['type'] = self.domains[f['domain']] elif len(str(f['len'])) > 0 and len(str(f['scale'])) == 0: f['type'] = f['type'] + '(' + str(f['len']) + ')' @@ -111,7 +111,7 @@ class PDmanReader(object): # if __name__ == '__main__': - pdfile = r'D:\文档\工作\ATD\2023上半年\项目\昭通OA\表结构\昭通OA.pdma.json' + pdfile = r'C:\Users\89295\Desktop\昭通OA.pdma.json' reader = PDmanReader(pdfile) - all_table = reader.read_by_module('TEST') - print(all_table['test']) + all_table = reader.read_by_module('OA_CAR') + print(all_table)