app/soc/models/program.py
author Lennard de Rijk <ljvderijk@gmail.com>
Wed, 26 Aug 2009 18:45:01 +0200
changeset 2813 6f7af233b5b0
parent 2787 8408741aee63
permissions -rw-r--r--
Removed workflow property from Program model. This has become obsolete with the new Module approach. Also fixed a small error I made when reviewing Madhusudan's timeline patch in _editPost for Program View.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@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.
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
771
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 769
diff changeset
    17
"""This module contains the Program Model.
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 769
diff changeset
    18
"""
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
]
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
649
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    25
from google.appengine.ext import db
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    26
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    27
from django.utils.translation import ugettext
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
1698
a8da5a620236 Switch Program to regular presence
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    29
import soc.models.presence
766
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 740
diff changeset
    30
import soc.models.timeline
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    31
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
1698
a8da5a620236 Switch Program to regular presence
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1308
diff changeset
    33
class Program(soc.models.presence.Presence):
667
f96095df1433 Some more import sorting fixes and docstring typos in program modules and soc.views.helper.redirects module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 649
diff changeset
    34
  """The Program model, representing a Program ran by a Sponsor.
643
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
  """
b57d538a9dd3 Added programs
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    36
649
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    37
  #: Required field storing name of the group.
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    38
  name = db.StringProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    39
      verbose_name=ugettext('Name'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    40
  name.help_text = ugettext('Complete, formal name of the program.')
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    41
  name.example_text = ugettext(
849
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    42
      '<small><i>e.g.</i></small> <tt>Google Summer of Code 2009</tt>')
649
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    43
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    44
  #: Required field storing short name of the group.
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    45
  #: It can be used for displaying group as sidebar menu item.
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    46
  short_name = db.StringProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    47
      verbose_name=ugettext('Short name'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    48
  short_name.help_text = ugettext('Short name used for sidebar menu')
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    49
  short_name.example_text = ugettext(
849
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    50
      '<small><i>e.g.</i></small> <tt>GSoC 2009</tt>')
649
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    51
688
125cad9596da Changed generic_name to group_label in models/program.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 667
diff changeset
    52
  #: Optional field used to relate it to other programs
125cad9596da Changed generic_name to group_label in models/program.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 667
diff changeset
    53
  #: For example, GSoC would be a group label for GSoC2008/GSoC2009
125cad9596da Changed generic_name to group_label in models/program.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 667
diff changeset
    54
  group_label = db.StringProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    55
      verbose_name=ugettext('Group label'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    56
  group_label.help_text = ugettext(
740
caa143c799a7 Added some example_text to program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 688
diff changeset
    57
      'Optional name used to relate this program to others.')
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    58
  group_label.example_text = ugettext(
849
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    59
      '<small><i>e.g.</i></small> <tt>GSoC</tt>')
649
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    60
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    61
  #: Required field storing description of the group.
95a41542e693 Finish Program
Sverre Rabbelier <srabbelier@gmail.com>
parents: 643
diff changeset
    62
  description = db.TextProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    63
      verbose_name=ugettext('Description'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    64
  description.example_text = ugettext(
849
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    65
      '<small><i>for example:</i></small><br>'
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    66
      '<tt><b>GSoC 2009</b> is the <i>Google Summer of Code</i>,'
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    67
      ' but in <u>2009</u>!</tt><br><br>'
c193ac0ef593 Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents: 771
diff changeset
    68
      '<small><i>(rich text formatting is supported)</i></small>')
1966
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    69
1969
236f677c158c Typo and thinko fix in accepted_orgs_msg
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1966
diff changeset
    70
  #: Message displayed at the top of the accepted organizations page.
1966
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    71
  accepted_orgs_msg = db.TextProperty(required=False,
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    72
      verbose_name=ugettext('Accepted Organizations Message'))
1969
236f677c158c Typo and thinko fix in accepted_orgs_msg
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1966
diff changeset
    73
  accepted_orgs_msg.example_text = ugettext(
1966
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    74
      '<small><i>for example:</i></small><br>'
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    75
      '<tt>Students who wish to participate can find out more about'
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    76
      ' each mentoring organization below.</tt><br><br>'
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    77
      '<small><i>(rich text formatting is supported)</i></small>')
fcf246b379a7 Add an non-required accepted_orgs_msg property to program profile
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1698
diff changeset
    78
911
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    79
  #: Required field storing application/tasks limit of the program.
2787
8408741aee63 Reverting last 4 patches containing GHOP related views.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 2784
diff changeset
    80
  apps_tasks_limit = db.IntegerProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    81
      verbose_name=ugettext('Application/Tasks Limit'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
    82
  apps_tasks_limit.example_text = ugettext(
911
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    83
      '<small><i>e.g.</i></small> '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    84
      '<tt><b>20</b> is the student applications limit for <i>Google Summer '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    85
      'of Code</i>, but <b>1</b> is the tasks limit that the student can work '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    86
      'on at the same time during <i>GHOP</i></tt>')
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
    87
2138
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    88
  #: Optional field storing minimum slots per organization
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    89
  min_slots = db.IntegerProperty(required=False, default=2,
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    90
      verbose_name=ugettext('Min slots per org'))
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    91
  min_slots.help_text = ugettext(
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    92
      'The amount of slots each org should get at the very least')
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    93
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    94
  #: Optional field storing maximum slots per organization
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    95
  max_slots = db.IntegerProperty(required=False, default=50,
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    96
      verbose_name=ugettext('Max slots per org'))
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    97
  max_slots.help_text = ugettext(
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    98
      'The amount of slots each organization should get at most')
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
    99
911
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   100
  #: Required field storing slots limit of the program.
2787
8408741aee63 Reverting last 4 patches containing GHOP related views.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 2784
diff changeset
   101
  slots = db.IntegerProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
   102
      verbose_name=ugettext('Slots'))
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
   103
  slots.example_text = ugettext(
911
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   104
      '<small><i>e.g.</i></small> '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   105
      '<tt><b>500</b> might be an amount of slots for <i>Google Summer '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   106
      'of Code</i>, which indicates how many students can be accepted '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   107
      'to the program.<br>For <i>GHOP</i> this indicates how '
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   108
      'many tasks can be completed.</tt>')
efce8ee13b19 Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 849
diff changeset
   109
2138
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
   110
  #: Optional field storing the allocation of slots for this program
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
   111
  slots_allocation = db.TextProperty(required=False,
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
   112
      verbose_name=ugettext('the allocation of slots'))
70b4a5e90eb0 Store min and max slots in the program model
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1969
diff changeset
   113
2716
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   114
  #: Property that contains the minimum age of a student allowed to
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   115
  #: participate
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   116
  student_min_age = db.IntegerProperty(
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   117
      required=False, verbose_name=ugettext('Student minimum age'))
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   118
  student_min_age.group = ugettext('Contest Rules')
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   119
  student_min_age.help_text = ugettext(
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   120
      'Minimum age of the student to sign-up in years.')
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   121
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   122
  #: Property that contains the date as of which above student
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   123
  #: minimum age requirement holds. This is a DateTimeProperty because
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   124
  #: programs might run in a different timezone then the Appengine Server
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   125
  #: is running on.
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   126
  student_min_age_as_of = db.DateProperty(
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   127
      required=False, verbose_name=ugettext('Minimum age as of'))
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   128
  student_min_age_as_of.group = ugettext('Contest Rules')
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   129
  student_min_age_as_of.help_text = ugettext(
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   130
      'Date as of which the student minimum age requirement '
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   131
      'should be reached.')
9921ac952f13 Added minimum age property to Program model.
Madhusudan C.S. <madhusudancs@gmail.com>
parents: 2138
diff changeset
   132
766
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 740
diff changeset
   133
  #: Required 1:1 relationship indicating the Program the Timeline
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 740
diff changeset
   134
  #: belongs to.
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 740
diff changeset
   135
  timeline = db.ReferenceProperty(reference_class=soc.models.timeline.Timeline,
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 740
diff changeset
   136
                                 required=True, collection_name="program",
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 911
diff changeset
   137
                                 verbose_name=ugettext('Timeline'))
1051
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents: 970
diff changeset
   138
1260
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   139
  #: Whether the slots allocations are visible
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   140
  allocations_visible = db.BooleanProperty(default=False,
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   141
      verbose_name=ugettext('Slot allocations visible'))
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   142
  allocations_visible.help_text = ugettext(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   143
      'Field used to indicate if the slot allocations should be visible.')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   144
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   145
  #: Document reference property used for the Org Admin Agreement
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   146
  org_admin_agreement = db.ReferenceProperty(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   147
    reference_class=soc.models.document.Document,
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   148
    verbose_name=ugettext('Organization Admin Agreement'),
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   149
    collection_name='org_admin_agreement')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   150
  org_admin_agreement.help_text = ugettext(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   151
      'Document containing optional Mentor Agreement for participating as a '
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   152
      'Organization admin.')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   153
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   154
  #: Document reference property used for the Mentor Agreement
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   155
  mentor_agreement = db.ReferenceProperty(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   156
    reference_class=soc.models.document.Document,
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   157
    verbose_name=ugettext('Mentor Agreement'),
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   158
    collection_name='mentor_agreement')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   159
  mentor_agreement.help_text = ugettext(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   160
      'Document containing optional Mentor Agreement for participating as a '
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   161
      'Mentor.')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   162
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   163
  #: Document reference property used for the Student Agreement
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   164
  student_agreement = db.ReferenceProperty(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   165
    reference_class=soc.models.document.Document,
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   166
    verbose_name=ugettext('Student Agreement'),
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   167
    collection_name='student_agreement')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   168
  student_agreement.help_text = ugettext(
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   169
      'Document containing optional Student Agreement for participating as a '
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   170
      'Student.')
594c6b500378 Added Agreement properties to Program Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1107
diff changeset
   171
1107
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   172
  #: Status of the program
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   173
  #: Invisible: Program Stealth-Mode Visible to Hosts and Devs only
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   174
  #: Visible: Visible to everyone.
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   175
  #: Inactive: Not visible in sidebar but can be reached for date retention
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   176
  #: Invalid: Not visible or editable by anyone
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   177
  status = db.StringProperty(required=True, default='invisible',
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   178
      verbose_name=ugettext('Program Status'),
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   179
      choices=['invisible', 'visible', 'inactive', 'invalid'])
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   180
  status.example_text = ugettext(
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   181
      '<tt>Invisible: Program Stealth-Mode Visible to Hosts and Devs only.<br/>'
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   182
      'Visible: Visible to everyone.<br/>'
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   183
      'Inactive: Not visible in sidebar, not editable.<br/>'
a878188e225c Added status to program.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1057
diff changeset
   184
      'Invalid: Not visible or editable by anyone.</tt>')