22 ] |
22 ] |
23 |
23 |
24 from google.appengine.ext import db |
24 from google.appengine.ext import db |
25 |
25 |
26 from soc import models |
26 from soc import models |
27 import soc.models.author |
27 from soc.models import base |
|
28 import soc.models.org |
|
29 import soc.models.person |
28 |
30 |
29 |
31 |
30 class Administrator(db.Model): |
32 class Administrator(base.ModelWithFieldAttributes): |
31 """Administrator details for a specific Program. |
33 """Administrator details for a specific Program. |
|
34 """ |
|
35 |
|
36 #: A 1:1 relationship associating an Administrator with specific |
|
37 #: Person details and capabilities. The back-reference in the |
|
38 #: Person model is a Query named 'admin'. |
|
39 person = db.ReferenceProperty(reference_class=soc.models.person.Person, |
|
40 required=True, collection_name="admin") |
32 |
41 |
33 An Administrator entity participates in the following relationships |
42 #: A many:1 relationship associating Administrators with specific |
34 implemented as a db.ReferenceProperty elsewhere in another db.Model: |
43 #: Organization details and capabilities. The back-reference in the |
35 |
44 #: Organization model is a Query named 'admins'. |
36 host) an optional 1:1 relationship associating generic Administrator |
45 org = db.ReferenceProperty(reference_class=soc.models.org.Organization, |
37 details and capabilities with a specific Host. This relation is |
46 required=True, collection_name="admins") |
38 implemented as the 'host' back-reference Query of the Host model |
|
39 'admin' reference. |
|
40 """ |
|
41 |
|
42 #: A 1:1 relationship associating an Administrator with generic |
|
43 #: Author details and capabilities. The back-reference in the |
|
44 #: Author model is a Query named 'admin'. |
|
45 author = db.ReferenceProperty(reference_class=soc.models.author.Author, |
|
46 required=True, collection_name="admin") |
|