You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
1.0 KiB

from django.db import models
from django.forms import ModelForm, DateField, ChoiceField, RadioSelect, BooleanField
from django.contrib.admin.widgets import AdminDateWidget
from .models import Project, Volunteer, IFG, Library, TYPE_CHOICES
class ProjectForm(ModelForm):
start = DateField(widget=AdminDateWidget)
class Meta:
model = Project
# fields = '__all__'
exclude = ('pid',)
class VolunteerForm(ModelForm):
choice = ChoiceField(choices=TYPE_CHOICES, widget=RadioSelect,
label='Was möchtest Du beantragen?')
check = BooleanField(required=True, label='Ich stimme den Datenschutzbestimmungen und den Förderrichtlinen zu')
class Meta:
model = Volunteer
exclude = ('granted',)
class LibraryForm(ModelForm):
class Meta:
model = Library
exclude = ('realname', 'email', 'username', 'type', 'granted')
class IFGForm(ModelForm):
class Meta:
model = IFG
exclude = ('realname', 'email', 'username')