本文整理汇总了Python中flaskbb.management.models.Setting.invalidate_cache方法的典型用法代码示例。如果您正苦于以下问题:Python Setting.invalidate_cache方法的具体用法?Python Setting.invalidate_cache怎么用?Python Setting.invalidate_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flaskbb.management.models.Setting
的用法示例。
在下文中一共展示了Setting.invalidate_cache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install_plugin
# 需要导入模块: from flaskbb.management.models import Setting [as 别名]
# 或者: from flaskbb.management.models.Setting import invalidate_cache [as 别名]
def install_plugin(plugin):
plugin = get_plugin_from_all(plugin)
if plugin.installable and not plugin.uninstallable:
plugin.install()
Setting.invalidate_cache()
flash(_("Plugin has been installed."), "success")
else:
flash(_("Cannot install Plugin."), "danger")
return redirect(url_for("management.plugins"))
示例2: uninstall_plugin
# 需要导入模块: from flaskbb.management.models import Setting [as 别名]
# 或者: from flaskbb.management.models.Setting import invalidate_cache [as 别名]
def uninstall_plugin(plugin):
plugin = get_plugin_from_all(plugin)
if plugin.uninstallable:
plugin.uninstall()
Setting.invalidate_cache()
flash("Plugin {} has been uninstalled.".format(plugin.name), "success")
else:
flash("Cannot uninstall Plugin {}".format(plugin.name), "danger")
return redirect(url_for("management.plugins"))