diff options
Diffstat (limited to 'app/links/forms.py')
-rw-r--r-- | app/links/forms.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/links/forms.py b/app/links/forms.py index ca6205b..80a7c50 100644 --- a/app/links/forms.py +++ b/app/links/forms.py @@ -1,10 +1,17 @@ from django import forms -import autocomplete_light -from autocomplete_light.contrib.taggit_field import TaggitField, TaggitWidget +import dal +from dal_select2_taggit.widgets import TaggitSelect2 from .models import Link -class LinkForm(forms.ModelForm): - tags = TaggitField(widget=TaggitWidget('TagAutocomplete')) +from dal import autocomplete + + +class LinkForm(autocomplete.FutureModelForm): class Meta: - fields = '__all__' - model = Link + model = Link + fields = ('tags',) + widgets = { + 'tags': autocomplete.TaggitSelect2( + 'tag-autocomplete' + ) + } |