app/soc/models/org_app.py
author Sverre Rabbelier <srabbelier@gmail.com>
Thu, 05 Feb 2009 23:52:27 +0000
changeset 1230 b1b1897e4df1
parent 1229 ec3768cbf369
child 1231 ab19a8ad375f
permissions -rw-r--r--
Cleanup in org_app and replace ReferenceProperty with LinkProperty Using LinkProperty allows the org to host their idea's list on Melange through the Document system, and then specify the URL of that document. This also makes it possible for the orgs to specify a document that is not hosted on Melange. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     2
#
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     4
#
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     8
# 
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    10
# 
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    15
# limitations under the License.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    16
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    17
"""This module contains the Organization Application Model."""
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    18
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    19
__authors__ = [
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    20
  '"Todd Larsen" <tlarsen@google.com>',
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    21
]
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    22
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    23
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    24
from google.appengine.ext import db
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    25
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 936
diff changeset
    26
from django.utils.translation import ugettext
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    27
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    28
import soc.models.document
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    29
import soc.models.group_app
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    30
import soc.models.user
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    31
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    32
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    33
class OrgApplication(soc.models.group_app.GroupApplication):
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    34
  """Specialized questions for the Organization application.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    35
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    36
  These questions are in addition to those in the GroupApplication Model.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    37
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    38
  Eventually, this will be replaced with a Question/Answer/Quiz/Response
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    39
  approach.  At that time, existing OrgApplication entities will be migrated
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    40
  (converted) to their new representations in the Datastore.
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    41
  """
795
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    42
  
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    43
  prior_participation = db.TextProperty(required=False, verbose_name=ugettext(
795
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    44
      'Has your group participated previously?'
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    45
      ' If so, please summarize your involvement and any past successes'
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    46
      ' and failures.'))
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    47
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    48
  prior_application = db.TextProperty(required=False, verbose_name=ugettext(
795
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    49
      'If your group has not previously participated, have you applied in'
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    50
      ' the past?  If so, for what sort of participation?'))
8914adaa93a7 Added control fields to group_app.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 774
diff changeset
    51
  
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    52
  license_name = db.StringProperty(required=True, verbose_name=ugettext(
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    53
      'What license does your organization use?'))
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    54
 
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    55
  ideas = db.LinkProperty(required=True, verbose_name=ugettext(
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    56
      'What is the ideas list of your organization?'))
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    57
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    58
  dev_mailing_list = db.StringProperty(required=False, verbose_name=ugettext(
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    59
      'What is the main development mailing list for your group?'))
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 936
diff changeset
    60
  dev_mailing_list.help_text = ugettext(
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    61
      'Mailing list email address, URL to sign-up page, etc.')
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    62
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    63
  contrib_template = db.LinkProperty(required=False, verbose_name=ugettext(
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    64
      'What application template would you like contributors'
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    65
      ' to your organization to use.'))
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 936
diff changeset
    66
  contrib_template.help_text = ugettext(
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    67
      'This template can be used by contributors, such as students'
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    68
      ' and other non-member participants, when they apply to contribute'
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    69
      ' to the organization.')
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    70
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    71
  contrib_disappears = db.TextProperty(required=True, verbose_name=ugettext(
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    72
      'What is your plan for dealing with disappearing contributors?'))
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 936
diff changeset
    73
  contrib_disappears.help_text = ugettext(
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    74
      'Contributors include students and other non-member participants.')
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    75
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    76
  member_disappears = db.TextProperty(required=True, verbose_name=ugettext(
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    77
      'What is your plan for dealing with disappearing members?'))
1149
c8d2bd7be24f Changed some errors in the org_app model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 970
diff changeset
    78
  member_disappears.help_text = ugettext(
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    79
      'Members include mentors, administrators, and the like.')
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    80
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    81
  encourage_contribs = db.TextProperty(required=True, verbose_name=ugettext(
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    82
      'What steps will you take to encourage contributors to interact with'
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    83
      ' your community before, during, and after the program?'))
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    84
  encourage_contribs.help_text = contrib_disappears.help_text
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    85
1230
b1b1897e4df1 Cleanup in org_app and replace ReferenceProperty with LinkProperty
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
    86
  continued_contribs = db.TextProperty(required=True, verbose_name=ugettext(
774
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    87
      'What will you do to ensure that your accepted contributors stick'
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    88
      ' with the project after the program concludes?'))
88a827a9b614 Add hard-coded GroupApplication and OrgApplication Models.
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    89
  continued_contribs.help_text = contrib_disappears.help_text