app/soc/models/task.py
author Pawel Solyga <Pawel.Solyga@gmail.com>
Mon, 16 Feb 2009 22:41:52 +0000
changeset 1368 bd710a3ee7e7
parent 1308 35b75ffcbb37
permissions -rw-r--r--
Typo fix in seed_db module which caused loaded organization applications not to work correctly (wrong keyname). Patch by: Pawel Solyga Reviewed by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
2e9454e4924e Initial definition of the Work Model.
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.
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
# 
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
# 
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    17
"""This module contains the Task Model."""
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
__authors__ = [
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
  '"Todd Larsen" <tlarsen@google.com>',
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
]
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
622
073cbc33bbfe Remove unused import in soc.models.task.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 533
diff changeset
    24
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
from google.appengine.ext import db
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
533
ba3309b2fd30 Move LINK_ID and SCOPE_PATH regular expressions to soc/models/linkable.py.
Todd Larsen <tlarsen@google.com>
parents: 391
diff changeset
    27
import soc.models.linkable
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
import soc.models.proposal
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    29
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
533
ba3309b2fd30 Move LINK_ID and SCOPE_PATH regular expressions to soc/models/linkable.py.
Todd Larsen <tlarsen@google.com>
parents: 391
diff changeset
    31
class Task(soc.models.linkable.Linkable):
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
  """Model of a Task, which is a Proposal to be completed by Contributors.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    33
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    34
  A Task brings along a Proposal that was used to initiate the Task.  A Task
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
  may have a unique collection of Reviews, in addition to those attached to
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    36
  the original Proposal.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    37
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    38
  A Task entity participates in the following relationships implemented
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
  as a db.ReferenceProperty elsewhere in another db.Model:
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
   contributors)  a required many:many relationship associating all of
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    42
     the Contributors to a Task to the specific Task.  See the
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    43
     TasksContributors model for details.
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
  """
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
 
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    46
  #: A required many:1 relationship with the Proposal on which the
391
849aa913e9c8 Address comments to r844 and r845.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 385
diff changeset
    47
  #: Task is based.  A Task may be based on only a single Proposal,
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    48
  #: but a Proposal can be the foundation for multiple Tasks. The
391
849aa913e9c8 Address comments to r844 and r845.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 385
diff changeset
    49
  #: back-reference in the Proposal model is a Query named 'tasks'.
385
6d410bf49a82 Remove not used imports in models. Fix missing spaces in models when operator not preceded by a space. Add missing ugettext_lazy import to Proposal model.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 316
diff changeset
    50
  proposal = db.ReferenceProperty(reference_class=soc.models.proposal.Proposal,
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    51
                                  required=True,
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: 54
diff changeset
    52
                                  collection_name="tasks")
18
2e9454e4924e Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    53