author | Lennard de Rijk <ljvderijk@gmail.com> |
Fri, 23 Jan 2009 11:36:55 +0000 | |
changeset 916 | f18c0a56da8b |
parent 911 | efce8ee13b19 |
child 970 | 8b5611d5b053 |
permissions | -rw-r--r-- |
643 | 1 |
#!/usr/bin/python2.5 |
2 |
# |
|
3 |
# Copyright 2008 the Melange authors. |
|
4 |
# |
|
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 |
|
10 |
# |
|
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. |
|
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 | 19 |
|
20 |
__authors__ = [ |
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
|
22 |
] |
|
23 |
||
24 |
||
649 | 25 |
from google.appengine.ext import db |
26 |
||
643 | 27 |
from django.utils.translation import ugettext_lazy |
28 |
||
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 | 31 |
|
32 |
||
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 | 35 |
""" |
36 |
||
649 | 37 |
#: Required field storing name of the group. |
38 |
name = db.StringProperty(required=True, |
|
39 |
verbose_name=ugettext_lazy('Name')) |
|
40 |
name.help_text = ugettext_lazy('Complete, formal name of the program.') |
|
849
c193ac0ef593
Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents:
771
diff
changeset
|
41 |
name.example_text = ugettext_lazy( |
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 | 43 |
|
44 |
#: Required field storing short name of the group. |
|
45 |
#: It can be used for displaying group as sidebar menu item. |
|
46 |
short_name = db.StringProperty(required=True, |
|
47 |
verbose_name=ugettext_lazy('Short name')) |
|
48 |
short_name.help_text = ugettext_lazy('Short name used for sidebar menu') |
|
849
c193ac0ef593
Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents:
771
diff
changeset
|
49 |
short_name.example_text = ugettext_lazy( |
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 | 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( |
125cad9596da
Changed generic_name to group_label in models/program.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
667
diff
changeset
|
55 |
verbose_name=ugettext_lazy('Group label')) |
125cad9596da
Changed generic_name to group_label in models/program.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
667
diff
changeset
|
56 |
group_label.help_text = ugettext_lazy( |
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.') |
849
c193ac0ef593
Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents:
771
diff
changeset
|
58 |
group_label.example_text = ugettext_lazy( |
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 | 60 |
|
61 |
#: Required field storing description of the group. |
|
62 |
description = db.TextProperty(required=True, |
|
63 |
verbose_name=ugettext_lazy('Description')) |
|
849
c193ac0ef593
Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents:
771
diff
changeset
|
64 |
description.example_text = ugettext_lazy( |
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>') |
769
a0ee643fe832
Added an elementary workflow choosing method to program creation.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
766
diff
changeset
|
69 |
|
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
|
70 |
#: Required field storing application/tasks limit of the program. |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
71 |
apps_tasks_limit = db.IntegerProperty(required=True, |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
72 |
verbose_name=ugettext_lazy('Application/Tasks Limit')) |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
73 |
apps_tasks_limit.example_text = ugettext_lazy( |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
74 |
'<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
|
75 |
'<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
|
76 |
'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
|
77 |
'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
|
78 |
|
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 slots limit of the program. |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
80 |
slots = db.IntegerProperty(required=True, |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
81 |
verbose_name=ugettext_lazy('Slots')) |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
82 |
slots.example_text = ugettext_lazy( |
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>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
|
85 |
'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
|
86 |
'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
|
87 |
'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
|
88 |
|
769
a0ee643fe832
Added an elementary workflow choosing method to program creation.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
766
diff
changeset
|
89 |
#: Required field storing the type of workflow this program has |
a0ee643fe832
Added an elementary workflow choosing method to program creation.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
766
diff
changeset
|
90 |
workflow = db.StringProperty(required=True, |
a0ee643fe832
Added an elementary workflow choosing method to program creation.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
766
diff
changeset
|
91 |
choices=['gsoc', 'ghop'], |
771
0b1beae179f5
Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
769
diff
changeset
|
92 |
verbose_name= ugettext_lazy('Workflow type')) |
849
c193ac0ef593
Support HTML tags in form field example_text column.
Todd Larsen <tlarsen@google.com>
parents:
771
diff
changeset
|
93 |
workflow.example_text = ugettext_lazy( |
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
|
94 |
'<tt><b>Project-based</b> for GSoC workflow type,<br>' |
efce8ee13b19
Add slots and student applications/tasks limit integer properties to the Program model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
849
diff
changeset
|
95 |
'<b>Task-based</b> for GHOP workflow type.</tt>') |
766
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
96 |
|
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
97 |
#: Required 1:1 relationship indicating the Program the Timeline |
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
98 |
#: belongs to. |
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
99 |
timeline = db.ReferenceProperty(reference_class=soc.models.timeline.Timeline, |
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
100 |
required=True, collection_name="program", |
046b4b51eabf
Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
740
diff
changeset
|
101 |
verbose_name=ugettext_lazy('Timeline')) |