]> git.0d.be Git - django-panik-combo.git/blobdiff - panikombo/forms.py
add episode auto selection cell
[django-panik-combo.git] / panikombo / forms.py
index ed3991a8dd4b858bfd8c2eafa561403b990ff992..d9f60ec328c9afbfd9ddaa4834a0abfac0de2512 100644 (file)
@@ -1,9 +1,10 @@
 from django import forms
 from django_select2.widgets import HeavySelect2Widget, convert_to_js_string_arr
+from taggit.forms import TagWidget
 
 from emissions.models import SoundFile, Episode
 
-from .models import SoundCell, EpisodeCell
+from .models import SoundCell, EpisodeCell, EpisodeAutoSelectionCell
 from .views import soundfiles, episodes
 
 class SoundFileWidget(HeavySelect2Widget):
@@ -44,3 +45,10 @@ class EpisodeCellForm(forms.ModelForm):
     def __init__(self, *args, **kwargs):
         super(EpisodeCellForm, self).__init__(*args, **kwargs)
         self.fields['episode'].widget = EpisodeWidget(data_view=episodes)
+
+
+class EpisodeAutoSelectionCellForm(forms.ModelForm):
+    class Meta:
+        model = EpisodeAutoSelectionCell
+        fields = ('title', 'tags', 'category')
+        widgets = {'tags': TagWidget()}