forked from rc/aircox
cfr #121 Co-authored-by: Christophe Siraut <d@tobald.eu.org> Co-authored-by: bkfox <thomas bkfox net> Co-authored-by: Thomas Kairos <thomas@bkfox.net> Reviewed-on: rc/aircox#131 Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be> Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
35 lines
745 B
Python
35 lines
745 B
Python
from django import forms
|
|
from django.forms.models import modelformset_factory
|
|
|
|
from aircox import models
|
|
from .page import ChildPageForm
|
|
|
|
|
|
__all__ = ("EpisodeForm", "EpisodeSoundFormSet")
|
|
|
|
|
|
class EpisodeForm(ChildPageForm):
|
|
class Meta:
|
|
model = models.Episode
|
|
fields = ChildPageForm.Meta.fields
|
|
|
|
|
|
EpisodeSoundFormSet = modelformset_factory(
|
|
models.EpisodeSound,
|
|
fields=(
|
|
"position",
|
|
"episode",
|
|
"sound",
|
|
"broadcast",
|
|
),
|
|
widgets={
|
|
"broadcast": forms.CheckboxInput(),
|
|
"episode": forms.HiddenInput(),
|
|
# "sound": forms.HiddenInput(),
|
|
"position": forms.HiddenInput(),
|
|
},
|
|
can_delete=True,
|
|
extra=0,
|
|
)
|
|
"""Formset used in EpisodeUpdateView."""
|