app/projrev/models.py
changeset 39 e7880a8f7e04
parent 38 3cb38edbe05f
child 43 55e650bb9dbe
equal deleted inserted replaced
38:3cb38edbe05f 39:e7880a8f7e04
   716 
   716 
   717   # Field containing the district to which the institution belongs
   717   # Field containing the district to which the institution belongs
   718   # to in the state of India.
   718   # to in the state of India.
   719   district = models.CharField(max_length=256,
   719   district = models.CharField(max_length=256,
   720                               choices=sort_dict(DISTRICT_CHOICES),
   720                               choices=sort_dict(DISTRICT_CHOICES),
   721                               null=True)
   721                               null=True, blank=True)
   722   district.help_text = ('First select the state before selecting the district. '
   722   district.help_text = ('First select the state before selecting the district. '
   723       'Select the district of the state where this project is taken up.')
   723       'Select the district of the state where this project is taken up.')
   724 
   724 
   725   mobile_num = models.CharField(max_length=20)
   725   phone_num = models.CharField(max_length=20)
   726   mobile_num.help_text = 'Enter your mobile number.'
   726   phone_num.verbose_name = 'Phone Number'
       
   727   phone_num.help_text = 'Enter your mobile number.'
   727 
   728 
   728   fax_num = models.CharField(max_length=20, null=True, blank=True)
   729   fax_num = models.CharField(max_length=20, null=True, blank=True)
   729   fax_num.help_text = 'Enter your fax number with the code.'
   730   fax_num.help_text = 'Enter your fax number with the code.'
   730 
   731 
   731   # Field containing the autogenerated MICR code for the project.
   732   # Field containing the autogenerated MICR code for the project.
   783   @classmethod
   784   @classmethod
   784   def getDistrict(cls, code):
   785   def getDistrict(cls, code):
   785     """Get the District name from its code.
   786     """Get the District name from its code.
   786     """
   787     """
   787 
   788 
   788     return cls.DISTRICT_CHOICES[code]
   789     if code in cls.DISTRICT_CHOICES:
       
   790       return cls.DISTRICT_CHOICES[code]
       
   791     else:
       
   792       return None
   789 
   793 
   790   @classmethod
   794   @classmethod
   791   def getDistrictCode(cls, name):
   795   def getDistrictCode(cls, name):
   792     """Get the District code from its name.
   796     """Get the District code from its name.
   793     """
   797     """
   869   #: Field representing the relation to the corresponding project.
   873   #: Field representing the relation to the corresponding project.
   870   project = models.ForeignKey(Project)
   874   project = models.ForeignKey(Project)
   871 
   875 
   872   #: Field containing the comment entered along with the review.
   876   #: Field containing the comment entered along with the review.
   873   comment = models.TextField()
   877   comment = models.TextField()
       
   878   comment.verbose_name = 'Overall Comment'
   874   comment.help_text = "Enter your review comment about this proposal."
   879   comment.help_text = "Enter your review comment about this proposal."
   875 
   880 
   876   #: Field representing the reference to the person who
   881   #: Field representing the reference to the person who
   877   #: did the review.
   882   #: did the review.
   878   reviewer = models.ForeignKey(User, null=True)
   883   reviewer = models.ForeignKey(User, null=True)
   884   attribute1 = models.PositiveSmallIntegerField(
   889   attribute1 = models.PositiveSmallIntegerField(
   885       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   890       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   886   attribute1.verbose_name = ('Feasibility of the proposed activity and the '
   891   attribute1.verbose_name = ('Feasibility of the proposed activity and the '
   887       'appropriateness of the time frame.')
   892       'appropriateness of the time frame.')
   888 
   893 
       
   894   comment_a1 = models.TextField(blank=True)
       
   895   comment_a1.verbose_name = 'Comment'
       
   896   comment_a1.help_text = "Comment for this attribute."
       
   897 
   889   attribute2 = models.PositiveSmallIntegerField(
   898   attribute2 = models.PositiveSmallIntegerField(
   890       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   899       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   891   attribute2.verbose_name = ('Uniqueness/novelty/innovation of the said '
   900   attribute2.verbose_name = ('Uniqueness/novelty/innovation of the said '
   892       'proposal')
   901       'proposal')
   893 
   902 
       
   903   comment_a2 = models.TextField(blank=True)
       
   904   comment_a2.verbose_name = 'Comment'
       
   905   comment_a2.help_text = "Comment for this attribute."
       
   906 
   894   attribute3 = models.PositiveSmallIntegerField(
   907   attribute3 = models.PositiveSmallIntegerField(
   895       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   908       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   896   attribute3.verbose_name = ('Scope for inter-institutional collaboration and '
   909   attribute3.verbose_name = ('Scope for inter-institutional collaboration and '
   897       'development.')
   910       'development.')
   898 
   911 
       
   912   comment_a3 = models.TextField(blank=True)
       
   913   comment_a3.verbose_name = 'Comment'
       
   914   comment_a3.help_text = "Comment for this attribute."
       
   915 
   899   attribute4 = models.PositiveSmallIntegerField(
   916   attribute4 = models.PositiveSmallIntegerField(
   900       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   917       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   901   attribute4.verbose_name = ('The organisation of the programme to be carried '
   918   attribute4.verbose_name = ('The organisation of the programme to be carried '
   902       'out.')
   919       'out.')
   903 
   920 
       
   921   comment_a4 = models.TextField(blank=True)
       
   922   comment_a4.verbose_name = 'Comment'
       
   923   comment_a4.help_text = "Comment for this attribute."
       
   924 
   904   attribute5 = models.PositiveSmallIntegerField(
   925   attribute5 = models.PositiveSmallIntegerField(
   905       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   926       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   906   attribute5.verbose_name = ('The details of the work as the outlined by the '
   927   attribute5.verbose_name = ('The details of the work as the outlined by the '
   907       'principal investigator(PI).')
   928       'principal investigator(PI).')
   908 
   929 
       
   930   comment_a5 = models.TextField(blank=True)
       
   931   comment_a5.verbose_name = 'Comment'
       
   932   comment_a5.help_text = "Comment for this attribute."
       
   933 
   909   attribute6 = models.PositiveSmallIntegerField(
   934   attribute6 = models.PositiveSmallIntegerField(
   910       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   935       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   911   attribute6.verbose_name = ('Sufficiency of funds as requested by the PI.')
   936   attribute6.verbose_name = ('Sufficiency of funds as requested by the PI.')
       
   937 
       
   938   comment_a6 = models.TextField(blank=True)
       
   939   comment_a6.verbose_name = 'Comment'
       
   940   comment_a6.help_text = "Comment for this attribute."
   912 
   941 
   913   attribute7 = models.PositiveSmallIntegerField(
   942   attribute7 = models.PositiveSmallIntegerField(
   914       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   943       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   915   attribute7.verbose_name = ('Social impact/reach/spread of the outcome of the '
   944   attribute7.verbose_name = ('Social impact/reach/spread of the outcome of the '
   916       'proposal.')
   945       'proposal.')
   917 
   946 
       
   947   comment_a7 = models.TextField(blank=True)
       
   948   comment_a7.verbose_name = 'Comment'
       
   949   comment_a7.help_text = "Comment for this attribute."
       
   950 
   918   attribute8 = models.PositiveSmallIntegerField(
   951   attribute8 = models.PositiveSmallIntegerField(
   919       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   952       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   920   attribute8.verbose_name = ('Contribution of the proposal to minimizing the '
   953   attribute8.verbose_name = ('Contribution of the proposal to minimizing the '
   921       'digital divide in our country.')
   954       'digital divide in our country.')
   922 
   955 
       
   956   comment_a8 = models.TextField(blank=True)
       
   957   comment_a8.verbose_name = 'Comment'
       
   958   comment_a8.help_text = "Comment for this attribute."
       
   959 
   923   attribute9 = models.PositiveSmallIntegerField(
   960   attribute9 = models.PositiveSmallIntegerField(
   924       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   961       choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)])
   925   attribute9.verbose_name = ('Any other matter which is likely to affect the '
   962   attribute9.verbose_name = ('Any other matter which is likely to affect the '
   926       'execution of the project(max 600 characters).')
   963       'execution of the project(max 600 characters).')
       
   964 
       
   965   comment_a9 = models.TextField(blank=True)
       
   966   comment_a9.verbose_name = 'Comment'
       
   967   comment_a9.help_text = "Comment for this attribute."