generic forms ...

This commit is contained in:
vabene1111
2018-05-03 00:09:03 +02:00
parent 399f581d86
commit 284beb47af
27 changed files with 68 additions and 19 deletions

View File

@ -4,6 +4,7 @@ from django.utils.translation import gettext as _
from django import forms
from .models import *
# noinspection PyPackageRequirements
from dal import autocomplete
@ -66,7 +67,7 @@ class KeywordForm(forms.ModelForm):
class EditRecipeForm(forms.ModelForm):
class Meta:
model = Recipe
fields = ('name', 'category', 'keywords','path')
fields = ('name', 'category', 'keywords', 'path')
labels = {
'name': _('Name'),
@ -75,10 +76,6 @@ class EditRecipeForm(forms.ModelForm):
'path': _('Path'),
}
widgets = {
'keywords': autocomplete.ModelSelect2Multiple(url='dal_keyword')
}
def __init__(self, *args, **kwargs):
super(EditRecipeForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()