示例#1
0
 def get_graph_data(self):
     data = []
     for cls in get_graph_classes():
         instance = cls()
         dataset = instance.get_graph_data(slug=self.kwargs.get('slug'))
         data.append({'name': instance.name,
                      'data': dataset,
                      'startdate': dataset[0][0],
                      'stopdate': dataset[-1][0],
                      'type': instance.type,
                      'showpoints': instance.showpoints})
     return data