app/projrev/models.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 07 Aug 2009 03:56:08 +0530
changeset 16 bed14c9685a5
parent 4 8d9da911ed7d
child 18 05b9e60e6a10
permissions -rw-r--r--
Project model changes.
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
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    55
  # Field containing the district to which the institution belongs
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    56
  # to in the state of India.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    57
  district = models.CharField(max_length=256,
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    58
                              choices=DISTRICT_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    59
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    60
  # Field containing the autogenerated MICR code for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    61
  micr_code = models.CharField(max_length=15, unique=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    62
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    63
  # Field containing the status of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    64
  # status of the project can be one among the following
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    65
  # New, Revised, Funded, Pilot, DPE
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    66
  status = models.CharField(max_length=256,
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    67
                            choices=[('new', 'New'), ('pilot', 'Pilot'),
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    68
                                     ('invalid', 'Invalid')])
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    69
16
bed14c9685a5 Project model changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 4
diff changeset
    70
  last_updated_on = models.DateTimeField(auto_now=True)
bed14c9685a5 Project model changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 4
diff changeset
    71
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    72
  @classmethod
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    73
  def getLineItem(cls, code):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    74
    """Get the State name from its code.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    75
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    76
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    77
    line_item_dict = dict(cls.LINE_ITEM_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    78
    return line_item_dict[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
  @classmethod
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    81
  def getLineItemCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    82
    """Get the Line Item code from its name.
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    83
    """
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    84
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    85
    for ln_code, ln_name in cls.LINE_ITEM_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    86
      if ln_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    87
        return ln_code
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
    return None
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    90
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    91
  @classmethod
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    92
  def getState(cls, code):
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
    93
    """Get the State code from its name.
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    94
    """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    95
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    96
    state_dict = dict(cls.STATE_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    97
    return state_dict[code]
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
  @classmethod
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   100
  def getStateCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   101
    """Get the State code from its name.
0
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
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   104
    for st_code, st_name in cls.STATE_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   105
      if st_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   106
        return st_code
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   107
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   108
    return None
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   109
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   110
  @classmethod
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   111
  def getDistrict(cls, code):
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   112
    """Get the District name from its code.
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
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   115
    district_dict = dict(cls.DISTRICT_CHOICES)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   116
    return district_dict[code]
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   117
4
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   118
  @classmethod
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   119
  def getDistrictCode(cls, name):
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   120
    """Get the District code from its name.
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   121
    """
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   122
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   123
    for dt_code, dt_name in cls.DISTRICT_CHOICES:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   124
      if dt_name == name:
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   125
        return dt_code
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
    return None
8d9da911ed7d Withdraw of proposals.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 0
diff changeset
   128
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   129
class Proposal(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   130
  """Model class for the project's proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   131
  """
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   132
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   133
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   134
  project = models.ForeignKey(Project)
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
  #: Field containing the Line Item to which the project belongs to.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   137
  document = models.FileField(upload_to='proposals/%Y/%m/%d')
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   138
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   139
  #: Field containing the date on which the document was submitted
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   140
  submitted_on = models.DateTimeField(auto_now_add=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   141
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   142
  #: Field containing the reference to the user who submitted the proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   143
  submitted_by = models.ForeignKey(User, null=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   144
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   145
  #: Field containing the revision number of the proposal belonging to
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   146
  #: the Project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   147
  rev_num = models.PositiveIntegerField()
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
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   150
class Timeline(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   151
  """Model class for the project's timeline.
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
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   155
  project = models.ForeignKey(Project)
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
  #: Field containing the date and time of submission of proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   158
  submitted = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   159
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   160
  #: Field containing the last date and time of review of proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   161
  reviewed = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   162
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   163
  #: Field containing the date and time of amount paid for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   164
  amount_paid = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   165
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   166
  #: Field containing the date and time of presentation of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   167
  presentation = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   168
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   169
  #: Field containing the date and time of monitoring of the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   170
  monitoring = models.DateTimeField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   171
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
class Fund(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   174
  """Model class for the project's funds.
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
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   178
  project = models.ForeignKey(Project)
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
  #: Field containing the amount sanctioned as funds for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   181
  sanctioned = models.FloatField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   182
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   183
  #: Field containing the expenses for the sanctioned fund for
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   184
  #: the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   185
  expenses = 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 date and time on which the funds were
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   188
  #: sanctioned for the project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   189
  sanctioned_on = models.DateTimeField(auto_now_add=True)
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
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   192
class Review(models.Model):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   193
  """Model class for the project's proposal's review.
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
  #: Field representing the relation to the corresponding project.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   197
  project = models.ForeignKey(Project)
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
  #: Field containing the comment entered along with the review.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   200
  comment = models.TextField()
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   201
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   202
  #: Field representing the reference to the person who
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   203
  #: did the review.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   204
  reviewer = models.ForeignKey(User, null=True)
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 containing the date and time of review of the proposal.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   207
  reviewed_on = models.DateTimeField(auto_now_add=True)
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   208
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   209
  #: Field containing the review value for this attribute.
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   210
  attribute1 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   211
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
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
  attribute2 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   214
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   215
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   216
  attribute3 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   217
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   218
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   219
  attribute4 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   220
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   221
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   222
  attribute5 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   223
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   224
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   225
  attribute6 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   226
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   227
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   228
  attribute7 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   229
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   230
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   231
  attribute8 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   232
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   233
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   234
  attribute9 = models.PositiveSmallIntegerField(
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   235
      choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])