46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
|
|
from django.db import models
|
||
|
|
|
||
|
|
from wagtail.models import Page
|
||
|
|
from wagtail.fields import RichTextField
|
||
|
|
from wagtail.admin.panels import FieldPanel
|
||
|
|
from wagtailmedia.edit_handlers import MediaChooserPanel
|
||
|
|
from wagtail.api import APIField
|
||
|
|
|
||
|
|
|
||
|
|
class PodcastEpisodeIndexPage(Page):
|
||
|
|
intro = RichTextField(blank=True)
|
||
|
|
description = RichTextField(blank=True)
|
||
|
|
audio_file = models.ForeignKey(
|
||
|
|
"wagtailmedia.Media",
|
||
|
|
null=True,
|
||
|
|
blank=True,
|
||
|
|
on_delete=models.SET_NULL,
|
||
|
|
related_name="+",
|
||
|
|
)
|
||
|
|
|
||
|
|
content_panels = Page.content_panels + [
|
||
|
|
FieldPanel("intro"),
|
||
|
|
FieldPanel("description"),
|
||
|
|
MediaChooserPanel("audio_file")
|
||
|
|
]
|
||
|
|
|
||
|
|
api_fields = [
|
||
|
|
APIField("intro"),
|
||
|
|
APIField('description'),
|
||
|
|
]
|
||
|
|
|
||
|
|
class PodcastSeries(Page):
|
||
|
|
description = RichTextField(blank=True)
|
||
|
|
logo = models.ForeignKey(
|
||
|
|
"wagtailimages.Image",
|
||
|
|
null=True,
|
||
|
|
blank=True,
|
||
|
|
on_delete=models.SET_NULL,
|
||
|
|
related_name="+",
|
||
|
|
help_text="Podcast Series Logo",
|
||
|
|
)
|
||
|
|
|
||
|
|
content_panels = Page.content_panels + [
|
||
|
|
FieldPanel("description"),
|
||
|
|
FieldPanel("logo")
|
||
|
|
]
|