@@ -11,7 +11,7 @@ class ReviewerSettings(models.Model):
1111 """Keeps track of admin data associated with the reviewer in the
1212 particular team. There will be one record for each combination of
1313 reviewer and team."""
14- team = models .ForeignKey (Group )
14+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
1515 person = models .ForeignKey (Person )
1616 INTERVALS = [
1717 (7 , "Once per week" ),
@@ -28,8 +28,11 @@ class ReviewerSettings(models.Model):
2828 def __unicode__ (self ):
2929 return u"{} in {}" .format (self .person , self .team )
3030
31+ class Meta :
32+ verbose_name_plural = "reviewer settings"
33+
3134class UnavailablePeriod (models .Model ):
32- team = models .ForeignKey (Group )
35+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
3336 person = models .ForeignKey (Person )
3437 start_date = models .DateField (default = datetime .date .today , help_text = "Choose the start date so that you can still do a review if it's assigned just before the start date - this usually means you should mark yourself unavailable for assignment some time before you are actually away." )
3538 end_date = models .DateField (blank = True , null = True , help_text = "Leaving the end date blank means that the period continues indefinitely. You can end it later." )
@@ -60,40 +63,55 @@ def __unicode__(self):
6063class ReviewWish (models .Model ):
6164 """Reviewer wishes to review a document when it becomes available for review."""
6265 time = models .DateTimeField (default = datetime .datetime .now )
63- team = models .ForeignKey (Group )
66+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
6467 person = models .ForeignKey (Person )
6568 doc = models .ForeignKey (Document )
6669
6770 def __unicode__ (self ):
6871 return u"{} wishes to review {} in {}" .format (self .person , self .doc .name , self .team .acronym )
72+
73+ class Meta :
74+ verbose_name_plural = "review wishes"
6975
7076class ResultUsedInReviewTeam (models .Model ):
7177 """Captures that a result name is valid for a given team for new
7278 reviews. This also implicitly defines which teams are review
7379 teams - if there are no possible review results valid for a given
7480 team, it can't be a review team."""
75- team = models .ForeignKey (Group )
81+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
7682 result = models .ForeignKey (ReviewResultName )
7783
7884 def __unicode__ (self ):
7985 return u"{} in {}" .format (self .result .name , self .team .acronym )
8086
87+ class Meta :
88+ verbose_name = "review result used in review team setting"
89+ verbose_name_plural = "review result used in review team settings"
90+
8191class TypeUsedInReviewTeam (models .Model ):
8292 """Captures that a type name is valid for a given team for new
8393 reviews. """
84- team = models .ForeignKey (Group )
94+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
8595 type = models .ForeignKey (ReviewTypeName )
8696
8797 def __unicode__ (self ):
8898 return u"{} in {}" .format (self .type .name , self .team .acronym )
8999
100+ class Meta :
101+ verbose_name = "review type used in review team setting"
102+ verbose_name_plural = "review type used in review team settings"
103+
90104class NextReviewerInTeam (models .Model ):
91- team = models .ForeignKey (Group )
105+ team = models .ForeignKey (Group , limit_choices_to = ~ models . Q ( resultusedinreviewteam = None ) )
92106 next_reviewer = models .ForeignKey (Person )
93107
94108 def __unicode__ (self ):
95109 return u"{} next in {}" .format (self .next_reviewer , self .team )
96110
111+ class Meta :
112+ verbose_name = "next reviewer in team setting"
113+ verbose_name_plural = "next reviewer in team settings"
114+
97115class ReviewRequest (models .Model ):
98116 """Represents a request for a review and the process it goes through.
99117 There should be one ReviewRequest entered for each combination of
0 commit comments