|
|
@ -1,8 +1,8 @@ |
|
|
|
from django.db import models |
|
|
|
from django.forms import ModelForm, DateField |
|
|
|
from django.forms import ModelForm, DateField, ChoiceField, RadioSelect |
|
|
|
from django.contrib.admin.widgets import AdminDateWidget |
|
|
|
|
|
|
|
from .models import Project |
|
|
|
from .models import Project, Volunteer, IFG, Library |
|
|
|
|
|
|
|
class ProjectForm(ModelForm): |
|
|
|
|
|
|
@ -11,3 +11,23 @@ class ProjectForm(ModelForm): |
|
|
|
class Meta: |
|
|
|
model = Project |
|
|
|
fields = '__all__' |
|
|
|
|
|
|
|
class VolunteerForm(ModelForm): |
|
|
|
|
|
|
|
CHOICES = [('IFG','ifg'), |
|
|
|
('Lib','library'),] |
|
|
|
choice = ChoiceField(choices=CHOICES, widget=RadioSelect) |
|
|
|
|
|
|
|
class Meta: |
|
|
|
model = Volunteer |
|
|
|
fields = '__all__' |
|
|
|
|
|
|
|
class LibraryForm: |
|
|
|
class Meta: |
|
|
|
model = Library |
|
|
|
fields = '__all__' |
|
|
|
|
|
|
|
class IFGForm: |
|
|
|
class Meta: |
|
|
|
model = 'IFG' |
|
|
|
fields = '__all__' |