author | Pawel Solyga <Pawel.Solyga@gmail.com> |
Wed, 20 Aug 2008 18:36:55 +0000 | |
changeset 97 | d01d0ae7d6c8 |
parent 54 | 03e267d67478 |
child 181 | fdd29818a954 |
permissions | -rw-r--r-- |
14
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
17 |
"""This module contains the Contributor Model.""" |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
__authors__ = [ |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
'"Todd Larsen" <tlarsen@google.com>', |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
22 |
] |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
from google.appengine.ext import db |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
26 |
from soc import models |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
27 |
import soc.models.author |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
28 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
29 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
30 |
class Contributor(db.Model): |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
31 |
"""Contributor details for a specific Program. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
32 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
33 |
Some Contributor workflows have the Contributor (acting as an Author) |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
34 |
creating Proposals and desiring for one (or more?) of them to be |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
35 |
converted into Tasks by Reviewers and Hosts. Other workflows have the |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
36 |
Reviewers (acting as an Author) proposing Proposals, that Contributors |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
claim to convert them into Tasks. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
A Contributor entity participates in the following relationships implemented |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
as a db.ReferenceProperty elsewhere in another db.Model: |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
42 |
tasks) a many:many relationship associating all of the Tasks to which |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
43 |
a specific Contributor has contributed with that Contributor. See |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
44 |
the TasksContributors model for details. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
45 |
""" |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
46 |
|
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
47 |
#: a 1:1 relationship associating a Contributor with generic Author |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
48 |
#: details and capabilities. The back-reference in the Author |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
49 |
#: model is a Query named 'contributor'. |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
50 |
author = db.ReferenceProperty(reference_class=models.author.Author, |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
51 |
required=True, |
aec6d7b8e745
Initial implementation of the Contributor Model in the contributor.py module.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
52 |
collection_name="contributor") |