Add org ReferenceProperty to Administrator model (many:1 relationship associating Administrators with specific Organization). Update Organization model __doc__ string with information about the back-reference 'admins'.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Tue, 30 Sep 2008 14:00:11 +0000
changeset 212 8e208e326adb
parent 211 ec26682053df
child 213 75a8cc0200ad
Add org ReferenceProperty to Administrator model (many:1 relationship associating Administrators with specific Organization). Update Organization model __doc__ string with information about the back-reference 'admins'. Patch by: Pawel Solyga Review by: to-be-reviewed
app/soc/models/administrator.py
app/soc/models/organization.py
--- a/app/soc/models/administrator.py	Tue Sep 30 12:59:59 2008 +0000
+++ b/app/soc/models/administrator.py	Tue Sep 30 14:00:11 2008 +0000
@@ -24,11 +24,17 @@
 
 from google.appengine.ext import db
 
+from soc.models import organization
+
 import soc.models.reviewer
 
 
 class Administrator(soc.models.reviewer.Reviewer):
   """Administrator details for a specific Program.
   """
-  pass
+  #: A many:1 relationship associating Administrators with specific
+  #: Organization details and capabilities. The back-reference in the
+  #: Organization model is a Query named 'admins'.
+  org = db.ReferenceProperty(reference_class=organization.Organization,
+          required=True, collection_name="admins")
 
--- a/app/soc/models/organization.py	Tue Sep 30 12:59:59 2008 +0000
+++ b/app/soc/models/organization.py	Tue Sep 30 14:00:11 2008 +0000
@@ -35,6 +35,9 @@
      a specific Organization. This relation is implemented as the
      'reviewers' back-reference Query of the Organization model 'org'
      reference.
+   admins)  a many:1 relationship associating Administrators with a specific
+     Organization. This relation is implemented as the 'admins' back-reference
+     Query of the Organization model 'org' reference.
   """
   pass