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
Exemplo n.º 4
0
 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)
Exemplo n.º 6
0
 def update_meet_state(self, instance, meet_state):
     obj_dict = dict()
     obj_dict["meet_state"] = meet_state
     return Operation.update(instance, obj_dict)
Exemplo n.º 7
0
 def update_friend_state(self, instance, friend_state):
     obj_dict = dict()
     obj_dict["friend_state"] = friend_state
     return Operation.update(instance, obj_dict)
Exemplo n.º 8
0
 def restore(self, instance):
     obj_dict = {"state": 1}
     return Operation.update(instance, obj_dict)
Exemplo n.º 9
0
 def delete(self, instance):
     obj_dict = {"state": 0}
     return Operation.update(instance, obj_dict)
Exemplo n.º 10
0
 def restore(self, instance, has_state=False):
     if has_state:
         data = {"state": 1}
         return Operation.update(instance, data)
     return False
Exemplo n.º 11
0
 def delete(self, instance, has_state=False):
     if has_state:
         data = {"state": 0}
         return Operation.update(instance, data)
     else:
         return Operation.delete(instance)
Exemplo n.º 12
0
 def update(self, instance, data):
     return Operation.update(instance, data)