|
1 #!/usr/bin/python2.5 |
|
2 # |
|
3 # Copyright 2009 the Melange authors. |
|
4 # |
|
5 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 # you may not use this file except in compliance with the License. |
|
7 # You may obtain a copy of the License at |
|
8 # |
|
9 # http://www.apache.org/licenses/LICENSE-2.0 |
|
10 # |
|
11 # Unless required by applicable law or agreed to in writing, software |
|
12 # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 # See the License for the specific language governing permissions and |
|
15 # limitations under the License. |
|
16 |
|
17 """GradingSurveyGroup has the ability to link a GradingProjectSurvey to a |
|
18 ProjectSurvey for evaluation purposes. |
|
19 """ |
|
20 |
|
21 __authors__ = [ |
|
22 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
23 ] |
|
24 |
|
25 |
|
26 from google.appengine.ext import db |
|
27 |
|
28 from django.utils.translation import ugettext |
|
29 |
|
30 from soc.models import linkable |
|
31 from soc.models.grading_project_survey import GradingProjectSurvey |
|
32 from soc.models.project_survey import ProjectSurvey |
|
33 |
|
34 |
|
35 class GradingSurveyGroup(linkable.Linkable): |
|
36 """The GradingSurveyGroups links a ProjectSurvey with a GradingProjectSurvey. |
|
37 |
|
38 The purpose of this model is to be able to link two different types of |
|
39 Surveys together so that a decision can be made about whether or not a |
|
40 Student has passed the evaluation. This model will link the Surveys together |
|
41 a GradingRecord will link the SurveyRecords. |
|
42 |
|
43 Since this model is only used in GSoC style programs the scope will be set to |
|
44 a Program entity. The link_id can be auto-generated. |
|
45 |
|
46 A GradingSurvey group can also work with only a GradingProjectSurvey defined. |
|
47 |
|
48 The GradingSurveyGroup can have several GradingRecords attached to it. These |
|
49 will contain matching SurveyRecords for the surveys set in this group, of |
|
50 course only if they are filled in. |
|
51 """ |
|
52 |
|
53 #: GradingProjectSurvey which belongs to this group. |
|
54 grading_survey = db.ReferenceProperty( |
|
55 GradingProjectSurvey, required=True, |
|
56 collection_name='grading_survey_groups') |
|
57 |
|
58 #: non-required ProjectSurvey that belongs to this group. |
|
59 student_survey = db.ReferenceProperty( |
|
60 ProjectSurvey, required=False, |
|
61 collection_name='project_survey_groups') |
|
62 |
|
63 #: DateTime when the last GradingRecord update was started for this group. |
|
64 last_update_started = db.DateTimeProperty( |
|
65 verbose_name=ugettext('Last Record update started')) |
|
66 |
|
67 #: DateTime when the last GradingRecord update was completed for this group. |
|
68 last_update_complete = db.DateTimeProperty( |
|
69 verbose_name=ugettext('Last Record update completed')) |