Fix user_self calling editGet with a wrong parameter
[Melange.git] / app / soc / models / group_app.py
blob5ec6ea4da2ed2f50210a629610977a59e11752e4
1 #!/usr/bin/python2.5
3 # Copyright 2009 the Melange authors.
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
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.
17 """This module contains the Group Application Model."""
19 __authors__ = [
20 '"Todd Larsen" <tlarsen@google.com>',
24 from google.appengine.ext import db
26 from django.utils.translation import ugettext
28 import soc.models.document
29 import soc.models.linkable
30 import soc.models.user
33 class GroupApplication(soc.models.linkable.Linkable):
34 """Common application questions for all groups.
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 """
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('Group Name'))
46 name.help_text = ugettext('Complete, formal name of the group.')
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('Applicant'))
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('Home Page URL'))
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('Public Email'))
67 email.help_text = ugettext(
68 "Enter an email address to be used by would-be members seeking "
69 "additional information. This can be an individual's email address or a "
70 "mailing list address; use whichever will work best for you.")
72 #: Required description of the Group.
73 description = db.TextProperty(required=True,
74 verbose_name=ugettext('Description'))
76 why_applying = db.TextProperty(required=True,
77 verbose_name=ugettext(
78 'Why is your group applying to participate?'
79 ' What do you hope to gain by participating?'))
81 pub_mailing_list = db.StringProperty(required=True,
82 verbose_name=ugettext(
83 'What is the main public mailing list for your group?'))
84 pub_mailing_list.help_text = ugettext(
85 'Mailing list email address, URL to sign-up page, etc. If a mailing '
86 'list is not used please specify another method of communication used '
87 'within the group.')
89 irc_channel = db.StringProperty(required=True,
90 verbose_name=ugettext(
91 'Where is the main IRC channel for your group?'))
92 irc_channel.help_text = ugettext('IRC network and channel. If IRC is '
93 'not used please write something like not applicable.')
95 backup_admin = db.ReferenceProperty(reference_class=soc.models.user.User,
96 required=False, collection_name='group_app_backup_admin',
97 verbose_name=ugettext(
98 'Please select your backup group administrator.'))
100 member_criteria = db.TextProperty(required=True,
101 verbose_name=ugettext(
102 'What criteria do you use to select the members of your group?'
103 ' Please be as specific as possible.'))
104 member_criteria.help_text = ugettext(
105 'Members include mentors, administrators, and the like.')
107 # property containing the status of the application
108 # completed means that the application has been processed into a real group
109 # pre-accepted: used to indicate that the application has been accepted
110 # but the group cannot be made yet.
111 # pre-rejected: used to indicate that the application has been rejected
112 # but the applicant has not been informed yet.
113 status = db.StringProperty(required=True,
114 choices=['accepted','rejected','ignored','needs review','completed',
115 'pre-accepted', 'pre-rejected'],
116 default='needs review',
117 verbose_name=ugettext('Application Status'))
119 # timestamp to record the time on which this application has been created
120 created_on = db.DateTimeProperty(required=True, auto_now_add=True,
121 verbose_name=ugettext('Created on'))
123 # timestamp to record the time on which this application has been
124 # last modified also changes when the review properties change
125 last_modified_on = db.DateTimeProperty(required=True, auto_now=True,
126 verbose_name=ugettext('Last modified on'))