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
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
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))
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))