generic forms ...
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user