author | Pawel Solyga <Pawel.Solyga@gmail.com> |
Tue, 30 Sep 2008 16:26:30 +0000 | |
changeset 214 | 21f94815fc85 |
parent 181 | fdd29818a954 |
child 316 | 9efdc7bc3565 |
permissions | -rw-r--r-- |
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 |
# |
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
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 |
|
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
from google.appengine.ext import db |
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
26 |
from soc import models |
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
|
27 |
from soc.models import base |
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 |
|
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
|
31 |
class Task(base.ModelWithFieldAttributes): |
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 |
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
47 |
#: Task is based. A Task may be based on only a single Proposal, |
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 |
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
49 |
#: back-reference in the Proposal model is a Query named 'tasks'. |
2e9454e4924e
Initial definition of the Work Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
50 |
proposal = db.ReferenceProperty(reference_class=models.proposal.Proposal, |
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 |