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
757 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
  5. class ProjectForm(ModelForm):
  6. start = DateField(widget=AdminDateWidget)
  7. class Meta:
  8. model = Project
  9. fields = '__all__'
  10. class VolunteerForm(ModelForm):
  11. CHOICES = [('IFG','ifg'),
  12. ('Lib','library'),]
  13. choice = ChoiceField(choices=CHOICES, widget=RadioSelect)
  14. class Meta:
  15. model = Volunteer
  16. fields = '__all__'
  17. class LibraryForm:
  18. class Meta:
  19. model = Library
  20. fields = '__all__'
  21. class IFGForm:
  22. class Meta:
  23. model = 'IFG'
  24. fields = '__all__'