soc/models/administrator.py
author Sverre Rabbelier <srabbelier@gmail.com>
Thu, 08 May 2008 21:48:03 +0000
changeset 11 78502d4eb06e
child 13 7947bd33ebbf
permissions -rw-r--r--
Initial implementation of the Administrator Model in the administrator.py module. Reviewed-at: http://codereviews.googleopensourceprograms.com/21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
78502d4eb06e Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    33
  An Administrator entity participates in a number of relationships:
78502d4eb06e Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    34
78502d4eb06e Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
   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
    36
     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
    37
     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
    38
     'admin' reference.
78502d4eb06e Initial implementation of the Administrator Model in the administrator.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
  """
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
  #: 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
    42
  #: 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
    43
  #: 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
    44
  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
    45
		  		required=True, collection_name="admin")