

def save(self):
    if hasattr(self, 'chart_id'):
        chart = get_object_or_404(Chart, pk=self.chart_id)
    else:
        chart = Chart()
        report = get_object_or_404(Report, pk=self.report_id)
        chart.report = report
    chart.name = self.data['title']
    chart.options = dumps(self.data)
    chart.save()
    return chart

dataset/ETHPy150Open treeio/treeio/treeio/reports/forms.py ChartForm.save/original