3 # Copyright 2008 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 Model."""
20 '"Todd Larsen" <tlarsen@google.com>',
21 '"Lennard de Rijk" <ljvderijk@gmail.com>',
25 from google
.appengine
.ext
import db
27 from django
.utils
.translation
import ugettext
29 from soc
.models
import countries
31 import soc
.models
.role
32 import soc
.models
.school
35 class Student(soc
.models
.role
.Role
):
36 """Student details for a specific Program.
39 school_name
= db
.StringProperty(required
=True,
40 verbose_name
=ugettext('School Name'))
41 school_name
.group
= ugettext("4. Private Info")
42 school_country
= db
.StringProperty(required
=True,
43 verbose_name
=ugettext('School Country/Territory'),
44 choices
=countries
.COUNTRIES_AND_TERRITORIES
)
45 school_country
.group
= ugettext("4. Private Info")
47 #: Property to gain insight into where students heard about this program
48 program_knowledge
= db
.TextProperty(required
=True, verbose_name
=ugettext(
49 "How did you hear about this program?"))
50 program_knowledge
.help_text
= ugettext("Please be as "
51 "specific as possible, e.g. blog post (include URL if possible), mailing "
52 "list (please include list address), information session (please include "
53 "location and speakers if you can), etc.")
54 program_knowledge
.group
= ugettext("4. Private Info")
56 #: A many:1 relationship that ties multiple Students to the
57 #: School that they attend.
58 school
= db
.ReferenceProperty(reference_class
=soc
.models
.school
.School
,
59 required
=False, collection_name
='students')