I have a JSON file returned by another function in my "views.py" file and I'm trying to pass this JSON data to ChartMixin class, but I can't find a good way to do this, Any idea?
class ChartMixin(object):
def get_labels(self):
"""Return 7 labels."""
return ["January", "February", "March", "April", "May", "June", "July"]
def get_data(self):
"""Return 3 random dataset to plot."""
def data():
"""Return 7 randint between 0 and 100."""
return [randint(0, 100) for x in range(7)]
I have a JSON file returned by another function in my "views.py" file and I'm trying to pass this JSON data to ChartMixin class, but I can't find a good way to do this, Any idea?
And this is the ChartMixin class: