Browse Source

split up form

master
Benni Baermann 4 years ago
parent
commit
620511359d
2 changed files with 6 additions and 4 deletions
  1. +2
    -1
      input/forms.py
  2. +4
    -3
      input/views.py

+ 2
- 1
input/forms.py View File

@ -25,7 +25,8 @@ class VolunteerForm(ModelForm):
class LibraryForm(ModelForm): class LibraryForm(ModelForm):
class Meta: class Meta:
model = Library model = Library
fields = '__all__'
# fields = '__all__'
exclude = ('realname', 'email', 'username')
class IFGForm(ModelForm): class IFGForm(ModelForm):
class Meta: class Meta:

+ 4
- 3
input/views.py View File

@ -34,6 +34,7 @@ class ExternView(SessionWizardView):
template_name = "input/extern.html" template_name = "input/extern.html"
form_list = [VolunteerForm, LibraryForm] form_list = [VolunteerForm, LibraryForm]
def done(self, form_list, **kwargs): def done(self, form_list, **kwargs):
return render(self.request, 'done.html', {
'form_data': [form.cleaned_data for form in form_list],
})
return done(self.request)
# return render(self.request, 'saved', {
# 'form_data': [form.cleaned_data for form in form_list],
# })

Loading…
Cancel
Save