def create_auto(self, props=None): self.access.assert_can_admin_coll(self) auto = Auto(redis=self.redis, access=self.access) aid = auto.init_new(self, props) self.redis.sadd(self.AUTO_KEY.format(coll=self.my_id), aid) return aid
def get_auto(self, aid): if not self.access.can_admin_coll(self): return None auto = Auto(my_id=aid, redis=self.redis, access=self.access) if auto['owner'] != self.my_id: return None auto.owner = self return auto