author | Madhusudan.C.S <madhusudancs@gmail.com> |
Mon, 10 Aug 2009 00:06:31 +0530 | |
changeset 24 | 7257b66a6766 |
parent 19 | 0c9bdcfac9f7 |
child 26 | 97bd3c28c957 |
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 |
||
24
7257b66a6766
Purr implemented for submit form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
19
diff
changeset
|
19 |
document = forms.FileField(required=False, help_text='Select the document path from your local file system.') |
0 | 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. |
|
19 | 29 |
fields = ('line_item', 'institution', 'state', |
30 |
'district', 'mobile_num', 'fax_num') |
|
0 | 31 |
|
32 |
class ReviewForm(forms.ModelForm): |
|
33 |
"""Creates a form for review of proposal. |
|
34 |
""" |
|
35 |
||
36 |
project = forms.ModelChoiceField(queryset=Project.objects.all(), |
|
37 |
widget=forms.HiddenInput(), |
|
38 |
required=False) |
|
39 |
||
40 |
class Meta: |
|
41 |
# Create a form from Review data model. |
|
42 |
model = Review |
|
43 |
||
1 | 44 |
exclude = ('reviewer') |