author | Sverre Rabbelier <srabbelier@gmail.com> |
Sat, 10 May 2008 02:15:40 +0000 | |
changeset 18 | 2e9454e4924e |
parent 13 | 7947bd33ebbf |
permissions | -rw-r--r-- |
11
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
17 |
"""This module contains the Administrator Model.""" |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
__authors__ = [ |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
'"Todd Larsen" <tlarsen@google.com>', |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
22 |
] |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
from google.appengine.ext import db |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
26 |
from soc import models |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
27 |
import soc.models.author |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
28 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
29 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
30 |
class Administrator(db.Model): |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
31 |
"""Administrator details for a specific Program. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
32 |
|
13
7947bd33ebbf
Clarify back-reference relations the same way that they are documented for
Todd Larsen <tlarsen@google.com>
parents:
11
diff
changeset
|
33 |
An Administrator entity participates in the following relationships |
7947bd33ebbf
Clarify back-reference relations the same way that they are documented for
Todd Larsen <tlarsen@google.com>
parents:
11
diff
changeset
|
34 |
implemented as a db.ReferenceProperty elsewhere in another db.Model: |
11
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
35 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
36 |
host) an optional 1:1 relationship associating generic Administrator |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
details and capabilities with a specific Host. This relation is |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
implemented as the 'host' back-reference Query of the Host model |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
'admin' reference. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
""" |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
|
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
42 |
#: A 1:1 relationship associating an Administrator with generic |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
43 |
#: Author details and capabilities. The back-reference in the |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
44 |
#: Author model is a Query named 'admin'. |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
45 |
author = db.ReferenceProperty(reference_class=soc.models.author.Author, |
78502d4eb06e
Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
46 |
required=True, collection_name="admin") |