car/utils/model.py

10 lines
252 B
Python
Raw Normal View History

2023-05-31 10:38:42 +08:00
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