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