equal
deleted
inserted
replaced
26 from google.appengine.ext import db |
26 from google.appengine.ext import db |
27 |
27 |
28 from django.utils.translation import ugettext |
28 from django.utils.translation import ugettext |
29 |
29 |
30 import soc.models.linkable |
30 import soc.models.linkable |
31 import soc.models.organization |
|
32 import soc.models.program |
|
33 import soc.models.role |
31 import soc.models.role |
34 import soc.models.student |
32 import soc.models.student |
35 import soc.models.user |
33 import soc.models.user |
36 |
34 |
|
35 import ghop.models.program |
37 |
36 |
38 class Task(soc.models.linkable.Linkable): |
37 |
|
38 class GHOPTask(soc.models.linkable.Linkable): |
39 """Model for a task used in GHOP workflow. |
39 """Model for a task used in GHOP workflow. |
40 |
40 |
41 The scope property of Linkable will be set to the Organization to which |
41 The scope property of Linkable will be set to the Organization to which |
42 this task belongs to. A link_id will be generated automatically and will |
42 this task belongs to. A link_id will be generated automatically and will |
43 have no specific meaning other than identification. |
43 have no specific meaning other than identification. |
51 #: Required field containing the description of the task |
51 #: Required field containing the description of the task |
52 description = db.TextProperty(required=True, |
52 description = db.TextProperty(required=True, |
53 verbose_name=ugettext('Description')) |
53 verbose_name=ugettext('Description')) |
54 description.help_text = ugettext('Complete description of the task') |
54 description.help_text = ugettext('Complete description of the task') |
55 |
55 |
56 #: field indicating the difficulty level of the task. This is not |
56 #: Field indicating the difficulty level of the Task. This is not |
57 #: mandatory so the it can be assigned at any later stage. |
57 #: mandatory so the it can be assigned at any later stage. |
58 #: The options are configured by a Program Admin. |
58 #: The options are configured by a Program Admin. |
59 difficulty = db.StringProperty(required=False, |
59 difficulty = db.StringProperty(required=False, |
60 verbose_name=ugettext('Difficulty')) |
60 verbose_name=ugettext('Difficulty')) |
61 difficulty.help_text = ugettext('Difficulty Level of the task') |
61 difficulty.help_text = ugettext('Difficulty Level of the task') |
90 student = db.ReferenceProperty(reference_class=soc.models.student.Student, |
90 student = db.ReferenceProperty(reference_class=soc.models.student.Student, |
91 required=False, |
91 required=False, |
92 collection_name='assigned_tasks') |
92 collection_name='assigned_tasks') |
93 |
93 |
94 #: Program in which this Task has been created |
94 #: Program in which this Task has been created |
95 program = db.ReferenceProperty(reference_class=soc.models.program.Program, |
95 program = db.ReferenceProperty(reference_class=ghop.models.program.GHOPProgram, |
96 required=True, |
96 required=True, |
97 collection_name='tasks') |
97 collection_name='tasks') |
98 |
98 |
99 #: Required property which holds the state, the Task is currently in. |
99 #: Required property which holds the state, the Task is currently in. |
100 #: This is a hidden field not shown on forms. Handled by logic internally. |
100 #: This is a hidden field not shown on forms. Handled by logic internally. |
122 'claim_requested', 'claimed', 'action_needed', |
122 'claim_requested', 'claimed', 'action_needed', |
123 'closed', 'awaiting_registration', 'needs_work', |
123 'closed', 'awaiting_registration', 'needs_work', |
124 'needs_review'], |
124 'needs_review'], |
125 default='unapproved') |
125 default='unapproved') |
126 |
126 |
127 #: A field which indicates if the task was ever in the Reopened state. |
127 #: A field which indicates if the Task was ever in the Reopened state. |
128 #: True indicates that its state was Reopened once, false indicated that it |
128 #: True indicates that its state was Reopened once, false indicated that it |
129 #: has never been in the Reopened state. |
129 #: has never been in the Reopened state. |
130 was_reopened = db.BooleanProperty(default=False, |
130 was_reopened = db.BooleanProperty(default=False, |
131 verbose_name=ugettext('Has been reopened')) |
131 verbose_name=ugettext('Has been reopened')) |
132 |
132 |