blog2.0/blog/base/models.py

21 lines
509 B
Python
Raw Normal View History

2024-06-14 15:56:37 +02:00
from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
@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,
)
panels = [
FieldPanel("title"),
FieldPanel("logo"),
]