app/soc/models/organization.py
author Sverre Rabbelier <srabbelier@gmail.com>
Mon, 30 Mar 2009 22:52:15 +0000
changeset 2037 3f355dca3679
parent 1994 bf64992d08c4
child 2129 f6ca1647bff7
permissions -rw-r--r--
Added nr_applications and nr_mentors These two properties can then be used to store the amount of applications and mentors an organization has. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     2
#
1308
35b75ffcbb37 Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1307
diff changeset
     3
# Copyright 2008 the Melange authors.
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     4
#
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     8
# 
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    10
# 
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    16
775
d18d286df40f Fixed missing import in soc/models/organization.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 773
diff changeset
    17
"""This module contains the Organization Model.
d18d286df40f Fixed missing import in soc/models/organization.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 773
diff changeset
    18
"""
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    19
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    20
__authors__ = [
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    21
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    22
]
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    23
316
9efdc7bc3565 Add missing blank lines between imports and sort all of the imports.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 244
diff changeset
    24
775
d18d286df40f Fixed missing import in soc/models/organization.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 773
diff changeset
    25
from google.appengine.ext import db
d18d286df40f Fixed missing import in soc/models/organization.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 773
diff changeset
    26
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 883
diff changeset
    27
from django.utils.translation import ugettext
775
d18d286df40f Fixed missing import in soc/models/organization.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 773
diff changeset
    28
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    29
import soc.models.group
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    30
316
9efdc7bc3565 Add missing blank lines between imports and sort all of the imports.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 244
diff changeset
    31
208
e076aee6e90f Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents: 181
diff changeset
    32
class Organization(soc.models.group.Group):
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    33
  """Organization details.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff changeset
    34
  """
1322
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    35
772
a91f7856754e Add IRC channel and mailing list properties to the Group and Organization
Todd Larsen <tlarsen@google.com>
parents: 748
diff changeset
    36
  #: Optional development mailing list.     
773
fefaf4628a4d Mailing list EmailProperty should be StringProperty instead, so that it is
Todd Larsen <tlarsen@google.com>
parents: 772
diff changeset
    37
  dev_mailing_list = db.StringProperty(required=False,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 883
diff changeset
    38
    verbose_name=ugettext('Development Mailing List'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 883
diff changeset
    39
  dev_mailing_list.help_text = ugettext(
772
a91f7856754e Add IRC channel and mailing list properties to the Group and Organization
Todd Larsen <tlarsen@google.com>
parents: 748
diff changeset
    40
    'Mailing list email address, URL to sign-up page, etc.')
1322
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    41
1567
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    42
  contrib_template = db.TextProperty(required=False, verbose_name=ugettext(
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    43
      'Application template'))
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    44
  contrib_template.help_text = ugettext(
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    45
      'This template can be used by contributors, such as students'
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    46
      ' and other non-member participants, when they apply to contribute'
b5589e656ed1 Member template in organization is now called Contributor Template.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1408
diff changeset
    47
      ' to the organization.')
772
a91f7856754e Add IRC channel and mailing list properties to the Group and Organization
Todd Larsen <tlarsen@google.com>
parents: 748
diff changeset
    48
1994
bf64992d08c4 Fixed a typo in Organization model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1760
diff changeset
    49
  ideas = db.LinkProperty(required=False, verbose_name=ugettext('Ideas list'))
1322
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    50
  ideas.help_text = ugettext(
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    51
      'The URL to the ideas list of your organization.')
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    52
  ideas.example_text = ugettext('For instance a link to a Melange public '
5153bd89147f Add an idea list (url) property to organization
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    53
      'document or some other URL')
1704
b581fdfd6bb1 Add slots to the organization model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1567
diff changeset
    54
1729
c5cfa7b3cdff Have slots default to 0
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1704
diff changeset
    55
  slots = db.IntegerProperty(required=False, default=0,
1704
b581fdfd6bb1 Add slots to the organization model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1567
diff changeset
    56
      verbose_name=ugettext('Slots allocated'))
b581fdfd6bb1 Add slots to the organization model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1567
diff changeset
    57
  slots.help_text = ugettext(
b581fdfd6bb1 Add slots to the organization model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1567
diff changeset
    58
      'The amount of slots allocated to this organization.')
1760
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    59
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    60
  slots_desired = db.IntegerProperty(required=False, default=0,
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    61
      verbose_name=ugettext('Slots desired'))
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    62
  slots_desired.help_text = ugettext(
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    63
      'The amount of slots desired by this organization.')
393891d794e2 Hide 'slots' and add 'slots_desired'
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1729
diff changeset
    64
2037
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    65
  nr_applications = db.IntegerProperty(required=False, default=0,
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    66
      verbose_name=ugettext('Amount of applications received'))
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    67
  nr_applications.help_text = ugettext(
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    68
      'The amount of applications received by this organization.')
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    69
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    70
  nr_mentors = db.IntegerProperty(required=False, default=0,
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    71
      verbose_name=ugettext('Amount of mentors assigned'))
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    72
  nr_mentors.help_text = ugettext(
3f355dca3679 Added nr_applications and nr_mentors
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1994
diff changeset
    73
      'The amount of mentors assigned to a proposal by this organization.')