Browse Source

added forms for multistep forms

master
Benni Baermann 4 years ago
parent
commit
28204aeab7
2 changed files with 23 additions and 2 deletions
  1. +1
    -0
      foerderbarometer/settings.py
  2. +22
    -2
      input/forms.py

+ 1
- 0
foerderbarometer/settings.py View File

@ -38,6 +38,7 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'formtools',
] ]
MIDDLEWARE = [ MIDDLEWARE = [

+ 22
- 2
input/forms.py View File

@ -1,8 +1,8 @@
from django.db import models from django.db import models
from django.forms import ModelForm, DateField
from django.forms import ModelForm, DateField, ChoiceField, RadioSelect
from django.contrib.admin.widgets import AdminDateWidget from django.contrib.admin.widgets import AdminDateWidget
from .models import Project
from .models import Project, Volunteer, IFG, Library
class ProjectForm(ModelForm): class ProjectForm(ModelForm):
@ -11,3 +11,23 @@ class ProjectForm(ModelForm):
class Meta: class Meta:
model = Project model = Project
fields = '__all__' fields = '__all__'
class VolunteerForm(ModelForm):
CHOICES = [('IFG','ifg'),
('Lib','library'),]
choice = ChoiceField(choices=CHOICES, widget=RadioSelect)
class Meta:
model = Volunteer
fields = '__all__'
class LibraryForm:
class Meta:
model = Library
fields = '__all__'
class IFGForm:
class Meta:
model = 'IFG'
fields = '__all__'

Loading…
Cancel
Save