author | Madhusudan.C.S <madhusudancs@gmail.com> |
Thu, 06 Aug 2009 18:15:57 +0530 | |
changeset 4 | 8d9da911ed7d |
parent 1 | 324233b04d76 |
child 6 | 17cab73c49eb |
permissions | -rw-r--r-- |
0 | 1 |
"""This module contains the form helpers |
2 |
""" |
|
3 |
||
4 |
||
5 |
__authors__ = [ |
|
6 |
'"Madhusudan.C.S" <madhusudancs@gmail.com>', |
|
7 |
] |
|
8 |
||
9 |
from django import forms |
|
10 |
||
11 |
from projrev.models import Project |
|
12 |
from projrev.models import Review |
|
13 |
||
14 |
class ProposalForm(forms.ModelForm): |
|
15 |
"""Creates a form for the project. |
|
16 |
""" |
|
17 |
||
18 |
document = forms.FileField() |
|
19 |
||
20 |
class Meta: |
|
21 |
# We store most of the data in Project model. So even though the |
|
22 |
# name and the purpose of the form is for Proposal acceptance, we |
|
23 |
# use Project model here. |
|
24 |
model = Project |
|
25 |
||
26 |
# fields in the Project that must not appear in the form, but have |
|
27 |
# be automatically generated. |
|
4
8d9da911ed7d
Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
1
diff
changeset
|
28 |
fields = ('line_item', 'institution', 'state', 'district') |
0 | 29 |
|
30 |
class ReviewForm(forms.ModelForm): |
|
31 |
"""Creates a form for review of proposal. |
|
32 |
""" |
|
33 |
||
34 |
project = forms.ModelChoiceField(queryset=Project.objects.all(), |
|
35 |
widget=forms.HiddenInput(), |
|
36 |
required=False) |
|
37 |
||
38 |
class Meta: |
|
39 |
# Create a form from Review data model. |
|
40 |
model = Review |
|
41 |
||
1 | 42 |
exclude = ('reviewer') |