def load_data(self, result): #Overwrite :meth:`stdnet.odm.PairMixin.load_data` method loads = self.pickler.loads vloads = self.value_pickler.loads dt = [loads(t) for t in result[0]] vals = {} for f, data in iterpair(result[1]): vals[f] = [vloads(d) for d in data] return (dt, vals)
def load_data(self, mapping, callback=None): loads = self.pickler.loads if self.value_pickler.require_session(): data1 = [] def _iterable(): for k, v in iterpair(mapping): data1.append(loads(k)) yield v res = self.value_pickler.load_iterable(_iterable(), self.session) callback = callback or passthrough return self.backend.execute( res, lambda data2: callback(zip(data1, data2))) else: vloads = self.value_pickler.loads data = [(loads(k), vloads(v)) for k, v in iterpair(mapping)] return callback(data) if callback else data
def _iterable(): for k, v in iterpair(mapping): data1.append(loads(k)) yield v
def load_data(self, mapping): loads = self.pickler.loads vloads = self.value_pickler.loads return ((loads(k), vloads(v)) for k,v in iterpair(mapping))
def load_get_data(self, result): vloads = self.value_pickler.loads return dict(((f, vloads(v)) for f, v in iterpair(result)))