app/soc/models/role.py
changeset 207 8ecc2e4198cd
child 385 6d410bf49a82
equal deleted inserted replaced
206:832335761384 207:8ecc2e4198cd
       
     1 #!/usr/bin/python2.5
       
     2 #
       
     3 # Copyright 2008 the Melange authors.
       
     4 #
       
     5 # Licensed under the Apache License, Version 2.0 (the "License");
       
     6 # you may not use this file except in compliance with the License.
       
     7 # You may obtain a copy of the License at
       
     8 # 
       
     9 #   http://www.apache.org/licenses/LICENSE-2.0
       
    10 # 
       
    11 # Unless required by applicable law or agreed to in writing, software
       
    12 # distributed under the License is distributed on an "AS IS" BASIS,
       
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    14 # See the License for the specific language governing permissions and
       
    15 # limitations under the License.
       
    16 
       
    17 """This module contains the Administrator Model."""
       
    18 
       
    19 __authors__ = [
       
    20   '"Todd Larsen" <tlarsen@google.com>',
       
    21 ]
       
    22 
       
    23 
       
    24 from google.appengine.ext import db
       
    25 
       
    26 import soc.models.person
       
    27 
       
    28 
       
    29 class Role(soc.models.person.Person):
       
    30   """Information common to Program participation for all Roles.
       
    31 
       
    32   Role is the entity that is created when a Person actually participates
       
    33   in some fashion in a Program.  Person details could *possibly* be collected
       
    34   without actual participation (voluntary, opt-in, of course).
       
    35 
       
    36   A Role is a Person's participation in a single Program.  To avoid
       
    37   duplication of data entry, facilities will be available for selecting
       
    38   an existing Role associated with a particular User to be duplicated for
       
    39   participation in a new Program.
       
    40 
       
    41   A Person has to have at least one Role in order to be able to create
       
    42   any Work (such as a Document) on the site.  The easiest-to-obtain Role is
       
    43   probably Club Member (though Clubs can set their own membership criteria).
       
    44 
       
    45   A Role entity participates in the following relationships implemented
       
    46   as a db.ReferenceProperty elsewhere in another db.Model:
       
    47 
       
    48    documentation) a 1:many relationship of Documentation (tax forms,
       
    49      letters from schools, etc.) associated with the Role by Hosts.  This
       
    50      relation is implemented as the 'documentation' back-reference Query of
       
    51      the Documentation model 'role' reference.
       
    52 
       
    53    works) a many:many relationship with Works, stored in a separate
       
    54      WorksRoles model, representing the Work authored by this Role.
       
    55      See the WorksRoles model class for details.
       
    56   """
       
    57   pass
       
    58