import process
This commit is contained in:
@ -5,24 +5,6 @@ from django import forms
|
||||
from .models import *
|
||||
|
||||
|
||||
class RecipeForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Recipe
|
||||
fields = ('name', 'category', 'keywords')
|
||||
|
||||
labels = {
|
||||
'name': _('Name'),
|
||||
'category': _('Category'),
|
||||
'keywords': _('Keywords'),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(RecipeForm, self).__init__(*args, **kwargs)
|
||||
self.helper = FormHelper()
|
||||
self.helper.form_method = 'post'
|
||||
self.helper.add_input(Submit('save', _('Save'), css_class='btn-primary'))
|
||||
|
||||
|
||||
class EditRecipeForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Recipe
|
||||
@ -45,20 +27,21 @@ class EditRecipeForm(forms.ModelForm):
|
||||
class MonitorForm(forms.Form):
|
||||
path = forms.CharField(label=_('Path'))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MonitorForm, self).__init__(*args, **kwargs)
|
||||
self.helper = FormHelper()
|
||||
self.helper.form_method = 'post'
|
||||
self.helper.add_input(Submit('import', _('Sync'), css_class='btn-primary'))
|
||||
|
||||
|
||||
class BatchEditForm(forms.Form):
|
||||
search = forms.CharField(label=_('Search String'))
|
||||
category = forms.ModelChoiceField(queryset=Category.objects.all().order_by('id'), required=False)
|
||||
keyword = forms.ModelMultipleChoiceField(queryset=Keyword.objects.all().order_by('id'), required=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(BatchEditForm, self).__init__(*args, **kwargs)
|
||||
self.helper = FormHelper()
|
||||
self.helper.form_method = 'post'
|
||||
self.helper.add_input(Submit('update', _('Update'), css_class='btn-primary'))
|
||||
|
||||
class ImportRecipeForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Recipe
|
||||
fields = ('name', 'category', 'keywords', 'path')
|
||||
|
||||
labels = {
|
||||
'name': _('Name'),
|
||||
'category': _('Category'),
|
||||
'keywords': _('Keywords'),
|
||||
'path': _('Path'),
|
||||
}
|
||||
|
Reference in New Issue
Block a user