car/utils/model.py
2023-05-31 11:52:34 +08:00

10 lines
252 B
Python

def model_list(result):
_list = []
for row in result:
_dict = {}
for k, v in row.__dict__.items():
if not k.startswith('_sa_instance_state'):
_dict[k] = v
_list.append(_dict)
return _list