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
--- 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