blog2.0/blog/base/models.py

23 lines
619 B
Python

from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
from wagtail.fields import RichTextField
@register_setting
class SiteSettings(BaseSiteSetting):
title = models.CharField(max_length=32, blank=True)
logo = models.ForeignKey(
"wagtailimages.Image",
on_delete=models.CASCADE,
related_name="+",
null=True,
blank=True,
)
footer = RichTextField(blank=True)
panels = [
FieldPanel("title"),
FieldPanel("logo"),
FieldPanel("footer"),
]