Пример #1
0
 def disable_after_hook(self):
     hook_key = client.get_app_info().get('hook_key')
     if not hook_key:
         raise ValueError('`disable_before_hook` need LeanCloud hook key')
     self.ignore_hook('afterSave')
     self.ignore_hook('afterUpdate')
     self.ignore_hook('afterDelete')
     return self
Пример #2
0
 def disable_before_hook(self):
     hook_key = client.get_app_info().get("hook_key")
     if not hook_key:
         raise ValueError("disable_before_hook need LeanCloud hook key")
     self.ignore_hook("beforeSave")
     self.ignore_hook("beforeUpdate")
     self.ignore_hook("beforeDelete")
     return self
Пример #3
0
 def disable_after_hook(self):
     master_key = client.get_app_info().get('master_key')
     if not master_key:
         raise ValueError('disable_before_hook need LeanCloud master key')
     timestamp = int(time.time() * 1000)
     return self.set(
         '__after',
         utils.sign_disable_hook('__after_for_' + self._class_name,
                                 master_key, timestamp))
Пример #4
0
 def disable_after_hook(self):
     master_key = client.get_app_info().get('master_key')
     if not master_key:
         raise ValueError('disable_before_hook need LeanCloud master key')
     timestamp = int(time.time() * 1000)
     return self.set('__after', utils.sign_disable_hook('__after_for_' + self._class_name, master_key, timestamp))