def set_find(self, query): return Operation.update(query, {"is_lost": False})
def set_online(self, instance, is_online): obj_dict = {"is_online": is_online} return Operation.update(instance, obj_dict)
def cancel_lost(self, query): if query: for instance in query: Operation.update(instance, {"is_lost": False}) return True return False
def update_type(self, instance, type): obj_dict = dict() obj_dict["type"] = type return Operation.update(instance, obj_dict)
def set_match(self, instance, is_match): obj_dict = {"is_match": is_match} return Operation.update(instance, obj_dict)
def update_meet_state(self, instance, meet_state): obj_dict = dict() obj_dict["meet_state"] = meet_state return Operation.update(instance, obj_dict)
def update_friend_state(self, instance, friend_state): obj_dict = dict() obj_dict["friend_state"] = friend_state return Operation.update(instance, obj_dict)
def restore(self, instance): obj_dict = {"state": 1} return Operation.update(instance, obj_dict)
def delete(self, instance): obj_dict = {"state": 0} return Operation.update(instance, obj_dict)
def restore(self, instance, has_state=False): if has_state: data = {"state": 1} return Operation.update(instance, data) return False
def delete(self, instance, has_state=False): if has_state: data = {"state": 0} return Operation.update(instance, data) else: return Operation.delete(instance)
def update(self, instance, data): return Operation.update(instance, data)