def key(self): key = entity_pb.Reference() key.set_app(self.project_id) if self.namespace is not None: key.set_name_space(self.namespace) key.mutable_path().MergeFrom(Path.decode(self.path)) return key
def _unpack_keys(self, blob): keys = [] pos = 0 while pos < len(blob): namespace, pos = Text.decode(blob, pos) path, pos = Path.unpack(blob, pos) key = entity_pb.Reference() key.set_app(self.project_id) key.set_name_space(namespace) key.mutable_path().MergeFrom(Path.decode(path)) keys.append(key) return keys