def load_io(self): key = 'req_%s' % self.pk loaded_io = cache.get(key) if loaded_io: return loaded_io options = self.get_io_options() loaded_io = flattened(self.webservice.io_class, **options) cache.set(key, loaded_io, 60 * 60 * 2) return loaded_io
def load(self): super(RegionDailyDataIO, self).load() for station in self.data: station['data'] = flattened( StationDailyDataIO, station=station['stationTriplet'], start_date=self.getvalue('start_date'), end_date=self.getvalue('end_date'), parameter=self.getvalue('parameter'), debug=self.debug, )