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