Esempio n. 1
0
 def clear_lock(key):
     try:
         obj = Locks.get(Locks.title == key)
         obj.delete_instance()
         return True
     except Locks.DoesNotExist:
         return False
Esempio n. 2
0
 def lock_obj(key, val):
     try:
         lk = Locks()
         lk.title = key
         lk.value = val
         lk.save()
         return val
     except BaseException:
         obj = Locks.get(Locks.title == key)
         return obj.value
Esempio n. 3
0
 def get_lock(key):
     try:
         obj = Locks.get(Locks.title == key)
         return obj.value
     except Locks.DoesNotExist:
         return False