Students now have a reference to school again.
authorLennard de Rijk <ljvderijk@gmail.com>
Tue, 17 Feb 2009 20:15:43 +0000
changeset 1383 18383d2e5a5b
parent 1382 293a14668dc9
child 1384 bb22ea156567
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
app/soc/models/student.py
app/soc/views/models/student.py
--- a/app/soc/models/student.py	Tue Feb 17 20:07:20 2009 +0000
+++ b/app/soc/models/student.py	Tue Feb 17 20:15:43 2009 +0000
@@ -24,9 +24,15 @@
 from google.appengine.ext import db
 
 import soc.models.role
+import soc.models.school
 
 
 class Student(soc.models.role.Role):
   """Student details for a specific Program.
   """
-  pass
+
+  #: A many:1 relationship that ties multiple Students to the
+  #: School that they attend.
+  school = db.ReferenceProperty(reference_class=soc.models.school.School,
+                                required=False, collection_name='students')
+
--- a/app/soc/views/models/student.py	Tue Feb 17 20:07:20 2009 +0000
+++ b/app/soc/views/models/student.py	Tue Feb 17 20:15:43 2009 +0000
@@ -87,7 +87,7 @@
         'Become a %(name)s'),]
     new_params['extra_django_patterns'] = patterns
 
-    new_params['extra_dynaexclude'] = ['agreed_to_tos']
+    new_params['extra_dynaexclude'] = ['agreed_to_tos', 'school']
 
     new_params['create_extra_dynafields'] = {
         'scope_path': forms.fields.CharField(widget=forms.HiddenInput,