app/soc/models/group_app.py
changeset 774 88a827a9b614
child 786 6d802e596a96
equal deleted inserted replaced
773:fefaf4628a4d 774:88a827a9b614
       
     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 Group Application Model."""
       
    18 
       
    19 __authors__ = [
       
    20   '"Todd Larsen" <tlarsen@google.com>',
       
    21 ]
       
    22 
       
    23 
       
    24 from google.appengine.ext import db
       
    25 
       
    26 from django.utils.translation import ugettext_lazy
       
    27 
       
    28 import soc.models.document
       
    29 import soc.models.linkable
       
    30 import soc.models.user
       
    31 
       
    32 
       
    33 class GroupApplication(soc.models.linkable.Linkable):
       
    34   """Common application questions for all groups.
       
    35 
       
    36   Eventually, this will be replaced with a Question/Answer/Quiz/Response
       
    37   approach.  At that time, existing OrgApplication entities will be migrated
       
    38   (converted) to their new representations in the Datastore.
       
    39   """
       
    40 
       
    41   #: Required field that will become the name of the Group in the profile,
       
    42   #: if the Group Application is accepted.
       
    43   #: See also:  soc.models.group.Group.name
       
    44   name = db.StringProperty(required=True,
       
    45       verbose_name=ugettext_lazy('Group Name'))
       
    46   name.help_text = ugettext_lazy('Complete, formal name of the group.')  
       
    47   
       
    48   #: Required many:1 relationship indicating the User who is applying on
       
    49   #: behalf of the Group.  If the Group Application is accepted, this User
       
    50   #: will become the founding User of the Group.
       
    51   #: See also:  soc.models.group.Group.founder
       
    52   applicant = db.ReferenceProperty(reference_class=soc.models.user.User,
       
    53     required=True, collection_name='group_apps',
       
    54     verbose_name=ugettext_lazy('Applicant'))
       
    55 
       
    56   #: Required field indicating the home page URL of the applying Group.
       
    57   #: See also:  soc.models.group.Group.home_page
       
    58   home_page = db.LinkProperty(required=True,
       
    59       verbose_name=ugettext_lazy('Home Page URL'))
       
    60   
       
    61   #: Required email address used as the "public" contact mechanism for
       
    62   #: the Group (as opposed to the applicant.account email address which is
       
    63   #: kept secret, revealed only to Developers).
       
    64   #: See also:  soc.models.group.Group.email
       
    65   email = db.EmailProperty(required=True,
       
    66     verbose_name=ugettext_lazy('Public Email'))
       
    67   
       
    68   #: Required description of the Group.
       
    69   description = db.TextProperty(required=True,
       
    70       verbose_name=ugettext_lazy('Description'))
       
    71 
       
    72   why_applying = db.TextProperty(required=True,
       
    73     verbose_name=ugettext_lazy(
       
    74       'Why is your group applying to participate?'
       
    75       ' What do you hope to gain by participating?'))
       
    76 
       
    77   prior_participation = db.TextProperty(required=False,
       
    78     verbose_name=ugettext_lazy(
       
    79       'Has your group participated previously?'
       
    80       ' If so, please summarize your involvement and any past successes'
       
    81       ' and failures. (optional)'))
       
    82 
       
    83   prior_application = db.TextProperty(required=False,
       
    84     verbose_name=ugettext_lazy(
       
    85       'If your group has not previously participated, have you applied in'
       
    86       ' the past?  If so, for what sort of participation? (optional)'))
       
    87 
       
    88   pub_mailing_list = db.StringProperty(required=False,
       
    89     verbose_name=ugettext_lazy(
       
    90       'What is the main public mailing list for your group? (optional)'))
       
    91   pub_mailing_list.help_text = ugettext_lazy(
       
    92     'Mailing list email address, URL to sign-up page, etc.')
       
    93 
       
    94   irc_channel = db.StringProperty(required=False,
       
    95     verbose_name=ugettext_lazy(
       
    96       'Where is the main IRC channel for your group?'
       
    97       ' (optional)'))
       
    98   irc_channel.help_text = ugettext_lazy('IRC network and channel.')
       
    99 
       
   100   backup_admin = db.ReferenceProperty(reference_class=soc.models.user.User,
       
   101     required=True,  collection_name='group_app_backup_admin',
       
   102     verbose_name=ugettext_lazy(
       
   103       'Please select your backup group administrator.'))
       
   104 
       
   105   member_criteria = db.TextProperty(required=True,
       
   106     verbose_text=ugettext_lazy(
       
   107       'What criteria do you use to select the members of your group?'
       
   108       ' Please be as specific as possible.'))
       
   109   member_disappears = ugettext_lazy(
       
   110     'Members include mentors, admininstrators, and the like.')
       
   111 
       
   112   member_template = db.ReferenceProperty(
       
   113     reference_class=soc.models.document.Document, required=False,
       
   114     collection_name='group_app_member_template',
       
   115     verbose_name=ugettext_lazy(
       
   116       'Please select the application template you would like potential'
       
   117       ' members of your group to use.  (optional).'))
       
   118   contrib_template.help_text = ugettext_lazy(
       
   119     'This template will be presented to potential members when they'
       
   120     ' apply to the group.')