|
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 """This module contains the Student Project Model. |
|
18 """ |
|
19 |
|
20 __authors__ = [ |
|
21 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
22 ] |
|
23 |
|
24 |
|
25 from google.appengine.ext import db |
|
26 |
|
27 from django.utils.translation import ugettext |
|
28 |
|
29 import soc.models.linkable |
|
30 import soc.models.mentor |
|
31 import soc.models.program |
|
32 import soc.models.student |
|
33 |
|
34 |
|
35 class StudentProject(soc.models.linkable.Linkable): |
|
36 """Model for a student project used in the GSoC workflow. |
|
37 """ |
|
38 |
|
39 #: Required field indicating the "title" of the project |
|
40 title = db.StringProperty(required=True, |
|
41 verbose_name=ugettext('Title')) |
|
42 title.help_text = ugettext('Title of the project') |
|
43 |
|
44 #: required, text field describing the project |
|
45 abstract = db.TextProperty(required=True) |
|
46 abstract.help_text = ugettext( |
|
47 'Short abstract, summary, or snippet;' |
|
48 ' 500 characters or less, plain text displayed publicly') |
|
49 |
|
50 #: optional, URL which can give more information about this project |
|
51 additional_info = db.URLProperty(required=False) |
|
52 additional_info.help_text = ugettext( |
|
53 'Link to a resource containing more information about this project.') |
|
54 |
|
55 #: A property containing which mentor has been assigned to this project. |
|
56 #: A project must have a mentor at all times |
|
57 mentor = db.ReferenceProperty(reference_class=soc.models.mentor.Mentor, |
|
58 required=True, |
|
59 collection_name='student_projects') |
|
60 |
|
61 #: the status of this project |
|
62 #: accepted: This project has been accepted into the program |
|
63 #: mid_term_passed: This project has passed the midterm evaluation |
|
64 #: mid_term_failed: This project has failed the midterm evaluation |
|
65 #: final_failed: This project has failed the final evaluation |
|
66 #: passed: This project has completed the program successfully |
|
67 status = db.StringProperty(required=True, default='accepted', |
|
68 choices=['accepted', 'mid_term_passed', 'mid_term_failed', |
|
69 'final_failed', 'passed']) |
|
70 |
|
71 #: student which this project is from |
|
72 student = db.ReferenceProperty( |
|
73 reference_class=soc.models.student.Student, |
|
74 required=True, collection_name='student_projects') |
|
75 |
|
76 #: program in which this project has been created |
|
77 program = db.ReferenceProperty(reference_class=soc.models.program.Program, |
|
78 required=True, |
|
79 collection_name='student_projects') |