def as_dict(self):
ret_dict = model_to_dict(self)
ret_dict['target'] = self.target.as_dict
ret_dict['molecules'] = [m.as_dict for m in self.molecules.all()]
ret_dict['location'] = self.location.as_dict
ret_dict['constraints'] = self.constraints.as_dict
ret_dict['windows'] = [w.as_dict for w in self.windows.all()]
return ret_dict
评论列表
文章目录