コード例 #1
0
 def set_find(self, query):
     return Operation.update(query, {"is_lost": False})
コード例 #2
0
 def set_online(self, instance, is_online):
     obj_dict = {"is_online": is_online}
     return Operation.update(instance, obj_dict)
コード例 #3
0
 def cancel_lost(self, query):
     if query:
         for instance in query:
             Operation.update(instance, {"is_lost": False})
         return True
     return False
コード例 #4
0
 def update_type(self, instance, type):
     obj_dict = dict()
     obj_dict["type"] = type
     return Operation.update(instance, obj_dict)
コード例 #5
0
 def set_match(self, instance, is_match):
     obj_dict = {"is_match": is_match}
     return Operation.update(instance, obj_dict)
コード例 #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)
コード例 #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)
コード例 #8
0
 def restore(self, instance):
     obj_dict = {"state": 1}
     return Operation.update(instance, obj_dict)
コード例 #9
0
 def delete(self, instance):
     obj_dict = {"state": 0}
     return Operation.update(instance, obj_dict)
コード例 #10
0
 def restore(self, instance, has_state=False):
     if has_state:
         data = {"state": 1}
         return Operation.update(instance, data)
     return False
コード例 #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)
コード例 #12
0
 def update(self, instance, data):
     return Operation.update(instance, data)