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

4 years ago
  1. from django.db import models
  2. from django.forms import ModelForm, DateField, ChoiceField, RadioSelect, BooleanField
  3. from django.contrib.admin.widgets import AdminDateWidget
  4. from .models import Project, Volunteer, IFG, Library, TYPE_CHOICES
  5. class ProjectForm(ModelForm):
  6. start = DateField(widget=AdminDateWidget)
  7. class Meta:
  8. model = Project
  9. # fields = '__all__'
  10. exclude = ('pid',)
  11. class VolunteerForm(ModelForm):
  12. choice = ChoiceField(choices=TYPE_CHOICES, widget=RadioSelect,
  13. label='Was möchtest Du beantragen?')
  14. check = BooleanField(required=True, label='Ich stimme den Datenschutzbestimmungen und den Förderrichtlinen zu')
  15. class Meta:
  16. model = Volunteer
  17. exclude = ('granted',)
  18. class LibraryForm(ModelForm):
  19. class Meta:
  20. model = Library
  21. exclude = ('realname', 'email', 'username', 'type', 'granted')
  22. class IFGForm(ModelForm):
  23. class Meta:
  24. model = IFG
  25. exclude = ('realname', 'email', 'username')