我在 Wagtail 中创建了一个自定义设置,允许在管理员中编辑警报横幅。
from django.db import models
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.admin.edit_handlers import FieldPanel
from ckeditor.fields import RichTextField
@register_setting
class AlertBanner(BaseSetting):
enable_alert_banner = models.BooleanField(default=False)
text = RichTextField(max_length=3000, default="", blank=True)
panels = [
FieldPanel('enable_alert_banner'),
FieldPanel('text'),
]
class Meta:
verbose_name = "Alert Banner"
我不想为某些用户授予管理员权限以便他们访问它。有没有办法允许编辑从管理菜单访问此设置?