def unarchive(self): self._obj.archived = False create_async_session().commit() return False
def archive(self): self._obj.archived = True create_async_session().commit() return True
def activate(self): self._obj.active = True create_async_session().commit() return True
def deactivate(self): self._obj.active = False create_async_session().commit() return False
def query_by_id(self): obj = create_async_session().query(self.__model).get(self.id) return obj