blob: e5c7c006eb85292e2aeca4ece8cbe4e49d71d7ed [file] [log] [blame]
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This module contains the GSoC specific Program Model.
"""
from google.appengine.ext import db
from django.utils.translation import ugettext
from soc.models import program
class GSoCProgramMessages(program.ProgramMessages):
"""The GSoCProgramMessages model.
"""
#: Message sent to the students that are accepted for the program.
accepted_students_msg = db.TextProperty(required=False,
verbose_name=ugettext('Accepted Students Message'))
#: Message sent to welcome accepted students to the program. This does
#: not include any personalized text from the organization they got
#: accepted for.
accepted_students_welcome_msg = db.TextProperty(required=False,
verbose_name=ugettext('Accepted Students Welcome Message'))
#: Message sent to the students that are rejected for the program.
rejected_students_msg = db.TextProperty(required=False,
verbose_name=ugettext('Rejected Students Message'))
class GSoCProgram(program.Program):
"""GSoC Program model extends the basic Program model.
"""
_messages_model = GSoCProgramMessages
homepage_url_name = "gsoc_homepage"
#: Required field storing application limit of the program.
apps_tasks_limit = db.IntegerProperty(required=True,
verbose_name=ugettext('Application/Tasks Limit'))
apps_tasks_limit.group = program.GENERAL_INFO_GROUP
apps_tasks_limit.help_text = ugettext(
'<small><i>e.g.</i></small> '
'<tt><b>20</b> is the student applications limit for <i>Google Summer '
'of Code</i>.</tt>')
#: Optional field storing minimum slots per organization
min_slots = db.IntegerProperty(required=False, default=1,
verbose_name=ugettext('Min slots per org'))
min_slots.group = program.GENERAL_INFO_GROUP
min_slots.help_text = ugettext(
'The amount of slots each org should get at the very least.')
#: Optional field storing maximum slots per organization
max_slots = db.IntegerProperty(required=False, default=50,
verbose_name=ugettext('Max slots per org'))
max_slots.group = program.GENERAL_INFO_GROUP
max_slots.help_text = ugettext(
'The amount of slots each organization should get at most.')
#: Required field storing slots limit of the program.
slots = db.IntegerProperty(required=True,
verbose_name=ugettext('Slots'))
slots.group = program.GENERAL_INFO_GROUP
slots.help_text = ugettext(
'<small><i>e.g.</i></small> '
'<tt><b>500</b> might be an amount of slots for <i>Google Summer '
'of Code</i>, which indicates how many students can be accepted.</tt>')
#: Optional field storing the allocation of slots for this program
slots_allocation = db.TextProperty(required=False,
verbose_name=ugettext('the allocation of slots.'))
#: Whether the slots allocations are visible
allocations_visible = db.BooleanProperty(default=False,
verbose_name=ugettext('Slot allocations visible'))
allocations_visible.group = program.GENERAL_INFO_GROUP
allocations_visible.help_text = ugettext(
'Field used to indicate if the slot allocations should be visible.')
#: Whether the duplicates are visible
duplicates_visible = db.BooleanProperty(default=False,
verbose_name=ugettext('Duplicate proposals visible'))
duplicates_visible.group = program.GENERAL_INFO_GROUP
duplicates_visible.help_text = ugettext(
'Field used to indicate if duplicate proposals should be made visible '
'to org admins.')