foerderbarometer/input/forms.py

34 lines
757 B
Python
Raw Normal View History

2020-09-29 07:54:31 +00:00
from django.db import models
2020-10-01 08:51:19 +00:00
from django.forms import ModelForm, DateField, ChoiceField, RadioSelect
2020-09-29 10:16:10 +00:00
from django.contrib.admin.widgets import AdminDateWidget
2020-10-01 08:51:19 +00:00
from .models import Project, Volunteer, IFG, Library
2020-09-29 07:54:31 +00:00
class ProjectForm(ModelForm):
2020-09-29 10:16:10 +00:00
start = DateField(widget=AdminDateWidget)
2020-09-29 07:54:31 +00:00
class Meta:
model = Project
fields = '__all__'
2020-10-01 08:51:19 +00:00
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__'