add skeleton for dnscms

This commit is contained in:
2024-05-07 01:41:37 +02:00
parent bd5e205ab0
commit 86b6d77bf1
49 changed files with 2158 additions and 0 deletions

View File

@ -0,0 +1,42 @@
from django.db import models
from wagtail.models import Page
from wagtail.fields import StreamField
from wagtail import blocks
from wagtail.admin.panels import FieldPanel
from wagtail.images.blocks import ImageChooserBlock
class Association(Page):
class AssociationType(models.TextChoices):
FORENING = "forening", "Forening"
UTVALG = "utvalg", "Utvalg"
body = StreamField(
[
("heading", blocks.CharBlock(form_classname="title")),
("paragraph", blocks.RichTextBlock()),
("image", ImageChooserBlock()),
]
)
association_type = models.CharField(
max_length=64, choices=AssociationType, default=AssociationType.FORENING
)
logo = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
url = models.URLField()
content_panels = Page.content_panels + [
# FieldPanel('author'),
# FieldPanel('date'),
FieldPanel("body"),
FieldPanel("logo"),
FieldPanel("association_type"),
FieldPanel("url"),
]