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):
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()}