def _build_from_raw(self, data): self.created = decode(types.DateTime())(data['created']) self.operations = list( map(partial(object_from_dict, Operation), list(map(decode_dict(Operation), data['operations'])))) self.versions = list( map(partial(object_from_dict, Version), list(map(decode_dict(Version), data['versions']))))
def _build_from_raw(self, data): self.created = decode(types.DateTime())(data['created']) self.node_id = decode(types.Integer())(data['node_id']) self.key = decode(types.String())(data['key']) self.latest_version_id = decode(types.Integer())( data['latest_version_id']) self.operations = map(partial(object_from_dict, Operation), imap(decode_dict(Operation), data['operations']))
def _from_raw(self, data): getm = lambda k: synched_models.model_names.get(k, null_model).model for k, v, m in ifilter(lambda (k, v, m): m is not None, imap(lambda (k, v): (k, v, getm(k)), data['payload'].iteritems())): self.payload[k] = set( map(lambda dict_: ObjectType(k, dict_[get_pk(m)], **dict_), imap(decode_dict(m), v)))
def _from_raw(self, data): getm = lambda k: synched_models.model_names.get(k, null_model).model for k, v, m in ifilter( lambda (k, v, m): m is not None, imap(lambda (k, v): (k, v, getm(k)), data['payload'].iteritems())): self.payload[k] = set( map(lambda dict_: ObjectType(k, dict_[get_pk(m)], **dict_), imap(decode_dict(m), v)))
def _from_raw(self, data): def getm(k): res = synched_models.model_names.get(k, null_model).model return res payload_items = list(data['payload'].items()) kvms = [(k, v, getm(k)) for (k, v) in iter(payload_items)] for (k, v, m) in \ [k_v_m for k_v_m in kvms if k_v_m[2] is not None ]: # breakpoint() self.payload[k] = set([ ObjectType(k, dict_[get_pk(m)], **dict_) for dict_ in map(decode_dict(m), v) ])
def _build_from_raw(self, data): self.node = object_from_dict(Node, decode_dict(Node)(data['node']))
def _build_from_raw(self, data): self.created = decode(types.DateTime())(data["created"]) self.operations = map(partial(object_from_dict, Operation), imap(decode_dict(Operation), data["operations"])) self.versions = map(partial(object_from_dict, Version), imap(decode_dict(Version), data["versions"]))
def _build_from_raw(self, data): self.operations = map(partial(object_from_dict, Operation), imap(decode_dict(Operation), data["operations"])) self.latest_version_id = decode(types.Integer())(data["latest_version_id"])
def _build_from_raw(self, data): self.operations = map(partial(object_from_dict, Operation), imap(decode_dict(Operation), data['operations'])) self.latest_version_id = decode(types.Integer())( data['latest_version_id'])