3 # Copyright 2009 the Melange authors.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 """This module contains the Student Project Model.
21 '"Lennard de Rijk" <ljvderijk@gmail.com>',
25 from google
.appengine
.ext
import db
27 from django
.utils
.translation
import ugettext
29 import soc
.models
.linkable
30 import soc
.models
.mentor
31 import soc
.models
.program
32 import soc
.models
.student
35 class StudentProject(soc
.models
.linkable
.Linkable
):
36 """Model for a student project used in the GSoC workflow.
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')
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')
50 #: Optional, text field containing all kinds of information about this project
51 public_info
= db
.TextProperty(required
=False, default
='')
52 public_info
.help_text
= ugettext(
53 'Additional information about this project to be shown publicly')
55 #: Optional, URL which can give more information about this project
56 additional_info
= db
.URLProperty(required
=False)
57 additional_info
.help_text
= ugettext(
58 'Link to a resource containing more information about this project.')
60 #: Optional field storing a feed URL; displayed publicly.
61 feed_url
= db
.LinkProperty(
62 verbose_name
=ugettext('Project Feed URL'))
63 feed_url
.help_text
= ugettext(
64 'The URL should be a valid ATOM or RSS feed. '
65 'Feed entries are shown on the public page.')
67 #: A property containing which mentor has been assigned to this project.
68 #: A project must have a mentor at all times
69 mentor
= db
.ReferenceProperty(reference_class
=soc
.models
.mentor
.Mentor
,
71 collection_name
='student_projects')
73 #: A property containing a list of additional Mentors for this project
74 additional_mentors
= db
.ListProperty(item_type
=db
.Key
, default
=[])
76 #: The status of this project
77 #: accepted: This project has been accepted into the program
78 #: mid_term_passed: This project has passed the midterm evaluation
79 #: mid_term_failed: This project has failed the midterm evaluation
80 #: final_failed: This project has failed the final evaluation
81 #: passed: This project has completed the program successfully
82 status
= db
.StringProperty(required
=True, default
='accepted',
83 choices
=['accepted', 'mid_term_passed', 'mid_term_failed',
84 'final_failed', 'passed'])
86 #: Student which this project is from
87 student
= db
.ReferenceProperty(
88 reference_class
=soc
.models
.student
.Student
,
89 required
=True, collection_name
='student_projects')
91 #: Program in which this project has been created
92 program
= db
.ReferenceProperty(reference_class
=soc
.models
.program
.Program
,
94 collection_name
='student_projects')