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.

33 lines
819 B

  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. class Meta:
  14. model = Volunteer
  15. fields = '__all__'
  16. class LibraryForm(ModelForm):
  17. class Meta:
  18. model = Library
  19. exclude = ('realname', 'email', 'username', 'type')
  20. class IFGForm(ModelForm):
  21. class Meta:
  22. model = IFG
  23. exclude = ('realname', 'email', 'username')