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.

34 lines
897 B

4 years ago
  1. from django.db import models
  2. from django.forms import ModelForm, DateField, ChoiceField, RadioSelect
  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. class Meta:
  15. model = Volunteer
  16. exclude = ('granted',)
  17. class LibraryForm(ModelForm):
  18. class Meta:
  19. model = Library
  20. exclude = ('realname', 'email', 'username', 'type', 'granted')
  21. class IFGForm(ModelForm):
  22. class Meta:
  23. model = IFG
  24. exclude = ('realname', 'email', 'username')