python - Django-graphos SimpleDataSource extension issue -
i'm building django web app use graphos add google charts app. have class customdatasource extending simpledatasource , i'm overriding get_data() method , working super fine , charts showing up.
now added __init__ constructor custom class pass variable need in get_data(). constructor being called fine , variable passed weird reason, get_data() method never called , cannot show chart.
class customdatasource(simpledatasource): def __init__(self, data, wcs): super(customdatasource, self).__init__(data) self.wcs = wcs print self.wcs def get_data(self): data = super(customdatasource, self).get_data() print 'get data ' # build data returned , return any ideas?
i solved it. made variable optional:
class customdatasource(simpledatasource): def __init__(self, data, wcs = none): super(customdatasource, self).__init__(data) self.wcs = wcs print self.wcs def get_data(self): data = super(customdatasource, self).get_data() print 'get data ' # build data returned , return i don't know why solved issue did.
Comments
Post a Comment