app/soc/models/student.py
author Lennard de Rijk <ljvderijk@gmail.com>
Tue, 17 Feb 2009 20:15:43 +0000
changeset 1383 18383d2e5a5b
parent 1374 ed12ed835755
child 1949 bcc52df68367
permissions -rw-r--r--
Students now have a reference to school again. This reference property is not required for now since the system for choosing your own school isn't implemented yet. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
207
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     2
#
1308
35b75ffcbb37 Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1307
diff changeset
     3
# Copyright 2008 the Melange authors.
207
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     4
#
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     8
# 
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    10
# 
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    15
# limitations under the License.
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    16
1077
8e0a17067b35 docstring fix in soc/models/student.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 207
diff changeset
    17
"""This module contains the Student Model."""
207
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    18
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    19
__authors__ = [
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    20
  '"Todd Larsen" <tlarsen@google.com>',
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    21
]
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    22
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    23
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    24
from google.appengine.ext import db
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    25
1374
ed12ed835755 Redone student model and added student logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1308
diff changeset
    26
import soc.models.role
1383
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    27
import soc.models.school
207
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    28
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    29
1374
ed12ed835755 Redone student model and added student logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1308
diff changeset
    30
class Student(soc.models.role.Role):
ed12ed835755 Redone student model and added student logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1308
diff changeset
    31
  """Student details for a specific Program.
207
8ecc2e4198cd Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    32
  """
1383
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    33
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    34
  #: A many:1 relationship that ties multiple Students to the
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    35
  #: School that they attend.
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    36
  school = db.ReferenceProperty(reference_class=soc.models.school.School,
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    37
                                required=False, collection_name='students')
18383d2e5a5b Students now have a reference to school again.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1374
diff changeset
    38