跳转到主要内容

用于周期性页面内容审查的Wagtail包

项目描述

Wagtail Periodic Review

用于定期对页面内容进行质量或审计审查的Wagtail软件包。

Build status Ruff pre-commit

A screenshot of the Wagtail administrative dashboard with periodic review panels

功能

  • 仪表板面板
  • 过滤报告
  • 可配置的下一次审查频率

安装

使用pip安装

  pip install wagtail-periodic-review

安装模块后,将wagtail_periodic_reviewwagtail.contrib.settings添加到设置文件中的已安装应用中

# settings.py

INSTALLED_APPS = [
    # ...
    "wagtail.contrib.settings",
    "wagtail_periodic_review",
]

运行迁移

$ ./manage.py migrate

用法

PeriodicReviewMixin添加到您的Page模型中

from wagtail.models import Page
from wagtail_periodic_review.models import PeriodicReviewMixin


class MyPage(PeriodicReviewMixin, Page):
    # Add the periodic review panels to the settings panels
    settings_panels = PeriodicReviewMixin.review_panels + Page.settings_panels

贡献

安装

要修改此项目,首先克隆此存储库

git clone git@github.com:zerolab/wagtail-periodic-review.git
cd wagtail-periodic-review

激活您首选的虚拟环境后,安装测试依赖项

使用pip

python -m pip install --upgrade "pip>=21.3"
python -m pip install -e '.[testing]' -U

使用flit

python -m pip install flit
flit install

pre-commit

请注意,此项目使用pre-commit。要本地设置,请按照以下步骤操作

# if you don't have it yet, globally
$ python -m pip install pre-commit
# go to the project directory
$ cd wagtail-periodic-review
# initialize pre-commit
$ pre-commit install

# Optional, run all checks once for this, then the checks will run only on the changed files
$ pre-commit run --all-files

如何运行测试

现在您可以按照以下示例运行测试

tox

或者,您可以针对特定环境运行它们tox -e python3.12-django4.2-wagtail5.2或特定测试tox -e python3.12-django4.2-wagtail5.2 -- tests.test_file.TestClass.test_method

要交互式运行测试应用,请使用tox -e interactive,访问http://127.0.0.1:8020/admin/并使用admin/changeme登录。

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面