app/projrev/models.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Sat, 08 Aug 2009 23:54:36 +0530
changeset 18 05b9e60e6a10
parent 16 bed14c9685a5
child 19 0c9bdcfac9f7
permissions -rw-r--r--
Changed CSS and removed Withdraw proposal.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
"""This module contains the data model for the project funded by NME
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
through ICT.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
"""
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
__authors__ = [
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     7
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     9
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
from django.db import models
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    12
from django.contrib.auth.models import User
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    14
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    15
class Project(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    16
  """Model class for NME funded projects.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    17
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    18
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    19
  LINE_ITEM_CHOICES = [('ME', 'Mechanical'), 
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    20
                       ('CE', 'Chemical'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    21
                       ('EE', 'Electrical'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    22
                       ('AE', 'Aero Space'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    23
                       ('CS', 'Computer Science'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    24
                       ('IT', 'Information Technology'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    25
                      ]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    26
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    27
  STATE_CHOICES = [('MH', 'Maharashtra'), 
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    28
                   ('KA', 'Karnataka'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    29
                   ('KL', 'Kerala'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    30
                   ('TN', 'Tamil Nadu'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    31
                   ('AP', 'Andra Pradesh'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    32
                  ]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    33
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    34
  DISTRICT_CHOICES = [('AD', 'Adilabad'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    35
                      ('RT', 'Ratnagiri'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    36
                      ('MU', 'Mumbai suburban'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    37
                      ('PU', 'Pune'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    38
                      ('PL', 'Palakkad'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    39
                      ('BN', 'Bangalore Urban district'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    40
                      ('CK', 'Chikmagalur District'),
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    41
                     ]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    42
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    43
  # Field containing the Line Item to which the project belongs to.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    44
  line_item = models.CharField(max_length=256,
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    45
                               choices=LINE_ITEM_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    46
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    47
  # Field containing the name of the institution working on the
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    48
  # project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    49
  institution = models.CharField(max_length=256)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    50
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    51
  # Field containing the state to which the institution belongs to.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    52
  state = models.CharField(max_length=256,
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    53
                           choices=STATE_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    54
18
05b9e60e6a10 Changed CSS and removed Withdraw proposal.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 16
diff changeset
    55
  mobile_num = models.CharField(max_length=20)
05b9e60e6a10 Changed CSS and removed Withdraw proposal.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 16
diff changeset
    56
05b9e60e6a10 Changed CSS and removed Withdraw proposal.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 16
diff changeset
    57
  fax_num = models.CharField(max_length=20, null=True)
05b9e60e6a10 Changed CSS and removed Withdraw proposal.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 16
diff changeset
    58
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    59
  # Field containing the district to which the institution belongs
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    60
  # to in the state of India.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    61
  district = models.CharField(max_length=256,
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    62
                              choices=DISTRICT_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    63
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    64
  # Field containing the autogenerated MICR code for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    65
  micr_code = models.CharField(max_length=15, unique=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    66
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    67
  # Field containing the status of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    68
  # status of the project can be one among the following
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    69
  # New, Revised, Funded, Pilot, DPE
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    70
  status = models.CharField(max_length=256,
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    71
                            choices=[('new', 'New'), ('pilot', 'Pilot'),
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    72
                                     ('invalid', 'Invalid')])
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    73
16
bed14c9685a5 Project model changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 4
diff changeset
    74
  last_updated_on = models.DateTimeField(auto_now=True)
bed14c9685a5 Project model changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 4
diff changeset
    75
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    76
  @classmethod
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    77
  def getLineItem(cls, code):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    78
    """Get the State name from its code.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    79
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    80
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    81
    line_item_dict = dict(cls.LINE_ITEM_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    82
    return line_item_dict[code]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    83
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    84
  @classmethod
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    85
  def getLineItemCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    86
    """Get the Line Item code from its name.
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    87
    """
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    88
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    89
    for ln_code, ln_name in cls.LINE_ITEM_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    90
      if ln_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    91
        return ln_code
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    92
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    93
    return None
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    94
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    95
  @classmethod
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    96
  def getState(cls, code):
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    97
    """Get the State code from its name.
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    98
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    99
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   100
    state_dict = dict(cls.STATE_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   101
    return state_dict[code]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   102
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   103
  @classmethod
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   104
  def getStateCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   105
    """Get the State code from its name.
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   106
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   107
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   108
    for st_code, st_name in cls.STATE_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   109
      if st_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   110
        return st_code
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   111
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   112
    return None
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   113
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   114
  @classmethod
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   115
  def getDistrict(cls, code):
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   116
    """Get the District name from its code.
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   117
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   118
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   119
    district_dict = dict(cls.DISTRICT_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   120
    return district_dict[code]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   121
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   122
  @classmethod
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   123
  def getDistrictCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   124
    """Get the District code from its name.
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   125
    """
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   126
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   127
    for dt_code, dt_name in cls.DISTRICT_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   128
      if dt_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   129
        return dt_code
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   130
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   131
    return None
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   132
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   133
class Proposal(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   134
  """Model class for the project's proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   135
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   136
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   137
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   138
  project = models.ForeignKey(Project)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   139
 
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   140
  #: Field containing the Line Item to which the project belongs to.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   141
  document = models.FileField(upload_to='proposals/%Y/%m/%d')
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   142
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   143
  #: Field containing the date on which the document was submitted
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   144
  submitted_on = models.DateTimeField(auto_now_add=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   145
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   146
  #: Field containing the reference to the user who submitted the proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   147
  submitted_by = models.ForeignKey(User, null=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   148
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   149
  #: Field containing the revision number of the proposal belonging to
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   150
  #: the Project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   151
  rev_num = models.PositiveIntegerField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   152
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   153
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   154
class Timeline(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   155
  """Model class for the project's timeline.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   156
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   157
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   158
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   159
  project = models.ForeignKey(Project)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   160
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   161
  #: Field containing the date and time of submission of proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   162
  submitted = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   163
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   164
  #: Field containing the last date and time of review of proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   165
  reviewed = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   166
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   167
  #: Field containing the date and time of amount paid for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   168
  amount_paid = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   169
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   170
  #: Field containing the date and time of presentation of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   171
  presentation = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   172
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   173
  #: Field containing the date and time of monitoring of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   174
  monitoring = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   175
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   176
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   177
class Fund(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   178
  """Model class for the project's funds.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   179
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   180
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   181
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   182
  project = models.ForeignKey(Project)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   183
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   184
  #: Field containing the amount sanctioned as funds for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   185
  sanctioned = models.FloatField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   186
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   187
  #: Field containing the expenses for the sanctioned fund for
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   188
  #: the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   189
  expenses = models.FloatField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   190
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   191
  #: Field containing the date and time on which the funds were
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   192
  #: sanctioned for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   193
  sanctioned_on = models.DateTimeField(auto_now_add=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   194
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   195
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   196
class Review(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   197
  """Model class for the project's proposal's review.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   198
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   199
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   200
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   201
  project = models.ForeignKey(Project)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   202
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   203
  #: Field containing the comment entered along with the review.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   204
  comment = models.TextField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   205
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   206
  #: Field representing the reference to the person who
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   207
  #: did the review.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   208
  reviewer = models.ForeignKey(User, null=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   209
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   210
  #: Field containing the date and time of review of the proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   211
  reviewed_on = models.DateTimeField(auto_now_add=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   212
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   213
  #: Field containing the review value for this attribute.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   214
  attribute1 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   215
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   216
  
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   217
  attribute2 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   218
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   219
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   220
  attribute3 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   221
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   222
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   223
  attribute4 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   224
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   225
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   226
  attribute5 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   227
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   228
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   229
  attribute6 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   230
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   231
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   232
  attribute7 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   233
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   234
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   235
  attribute8 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   236
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   237
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   238
  attribute9 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   239
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])