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.

38 lines
1.1 KiB

  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
  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. CHOICES = [('BIB', 'Bibliotheksstipendium'),
  13. ('ELIT', 'eLiteraturstipendium'),
  14. ('SOFT', 'Softwarestipendium'),
  15. ('VIS', 'Visitenkarten, Mailingliste oder E-Mail-Adresse'),
  16. ('IFG', 'Kostenübernahme IFG-Anfrage'),
  17. ('LIT', 'Literaturstipendium'),]
  18. choice = ChoiceField(choices=CHOICES, widget=RadioSelect)
  19. class Meta:
  20. model = Volunteer
  21. fields = '__all__'
  22. class LibraryForm(ModelForm):
  23. class Meta:
  24. model = Library
  25. exclude = ('realname', 'email', 'username', 'type')
  26. class IFGForm(ModelForm):
  27. class Meta:
  28. model = IFG
  29. exclude = ('realname', 'email', 'username')