author | Todd Larsen <tlarsen@google.com> |
Wed, 07 May 2008 00:39:03 +0000 | |
changeset 8 | 102f69ecb4e4 |
child 13 | 7947bd33ebbf |
permissions | -rw-r--r-- |
8
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
2 |
# |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
4 |
# |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
8 |
# |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
10 |
# |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
16 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
17 |
"""This module contains the Person Model.""" |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
18 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
19 |
__authors__ = [ |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
20 |
'"Todd Larsen" <tlarsen@google.com>', |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
22 |
] |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
23 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
24 |
from google.appengine.ext import db |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
25 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
26 |
from soc import models |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
27 |
import soc.models.user |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
28 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
29 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
30 |
class Person(db.Model): |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
31 |
"""Common data fields for all Roles. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
32 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
33 |
A Person can only participate in a single Program. To avoid duplication of |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
34 |
data entry, facilities will be available for selecting an existing Person |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
35 |
associated with a particular User to be duplicated for participation in a |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
36 |
new Program. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
37 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
38 |
Some details of a Person are considered "public" information, and nearly |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
39 |
all of these are optional (except for givenname, surname, and email). |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
40 |
Other details of a Person are kept "private" and are only provided to |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
41 |
other Persons in roles that "need to know" this information. How these |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
42 |
fields are revealed is usually covered by Program terms of service. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
43 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
44 |
A Person entity participates in a number of relationships: |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
45 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
46 |
author) a 1:1 relationship of Person details for a specific Author. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
47 |
This relation is implemented as the 'author' back-reference Query of |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
48 |
the Author model 'person' reference. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
49 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
50 |
docs) a 1:many relationship of documents (Documentation) associated |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
51 |
with the Person by Administrators. This relation is implemented as |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
52 |
the 'docs' back-reference Query of the Documentation model 'person' |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
53 |
reference. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
54 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
55 |
""" |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
56 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
57 |
#: A required many:1 relationship that ties (possibly multiple |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
58 |
#: entities of) Person details to a unique User. A Person cannot |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
59 |
#: exist unassociated from a login identity and credentials. The |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
60 |
#: back-reference in the User model is a Query named 'persons'. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
61 |
user = db.ReferenceProperty(reference_class=models.user.User, |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
62 |
required=True, |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
63 |
collection_name="persons") |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
64 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
65 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
66 |
# (public) name information |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
67 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
68 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
69 |
#: Required field storing the parts of the Person's name |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
70 |
#: corresponding to the field names; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
71 |
#: Givenname can only be lower ASCII, not UTF-8 text, because it is |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
72 |
#: used, for example, as part of the shipping (mailing) address. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
73 |
givenname = db.StringProperty(required=True) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
74 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
75 |
#: Required field storing the parts of the Person's name |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
76 |
#: corresponding to the field names; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
77 |
#: Surname can only be lower ASCII, not UTF-8 text, because it is |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
78 |
#: used, for example, as part of the shipping (mailing) address. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
79 |
surname = db.StringProperty(required=True) # last name |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
80 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
81 |
#: Optional field storing a nickname; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
82 |
#: Nicknames can be any valid UTF-8 text. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
83 |
nickname = db.StringProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
84 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
85 |
#: optional field used as a display name, such as for awards |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
86 |
#: certificates. Should be the entire display name in the format |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
87 |
#: the Person would like it displayed (could be surname followed by |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
88 |
#: given name in some cultures, for example). Display names can be |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
89 |
#: any valid UTF-8 text. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
90 |
displayname = db.StringProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
91 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
92 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
93 |
# (public) contact information |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
94 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
95 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
96 |
#: Required field used as the "public" contact mechanism for the |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
97 |
#: Person (as opposed to the user.id email address which is |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
98 |
#: kept secret). |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
99 |
email = db.EmailProperty(required=True) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
100 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
101 |
#: Optional field storing Instant Messaging network contact |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
102 |
#: information; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
103 |
im = db.IMProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
104 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
105 |
#: Optional field storing a home page URL; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
106 |
homepage = db.LinkProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
107 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
108 |
#: Optional field storing a blog URL; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
109 |
blog = db.LinkProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
110 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
111 |
#: Optional field storing a URL to an image, expected to be a |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
112 |
#: personal photo (or cartoon avatar, perhaps); displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
113 |
photo = db.LinkProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
114 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
115 |
#: Optional field storing the latitude and longitude provided by |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
116 |
#: the Person; displayed publicly. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
117 |
location = db.GeoPtProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
118 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
119 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
120 |
# (private) contact information |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
121 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
122 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
123 |
#: Required field containing residence address; kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
124 |
residence = db.PostalAddressProperty(required=True) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
125 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
126 |
#: Optional field containg a separate shipping; kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
127 |
shipping = db.PostalAddressProperty() |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
128 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
129 |
#: Required field containing a phone number that will be supplied |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
130 |
#: to shippers; kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
131 |
phone = db.PhoneNumberProperty(required=True) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
132 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
133 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
134 |
# (private) personal information |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
135 |
#==================================================================== |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
136 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
137 |
#: Required field containing the Person's birthdate (for |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
138 |
#: determining Program participation eligibility); kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
139 |
birthdate = db.DateProperty(required=True) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
140 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
141 |
#: Optional field indicating choice of t-shirt, from XXS to XXXL; |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
142 |
#: kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
143 |
tshirtsize = db.StringProperty( |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
144 |
choices=set(("XXS", "XS", "S", "M", "L", "XL", "XXL", "XXXL"))) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
145 |
|
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
146 |
#: Optional field indicating choice of male or t-shirt |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
147 |
#: fit; kept private. |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
148 |
tshirt_gender = db.StringProperty(choices=set(("male", "female"))) |
102f69ecb4e4
Initial conversion of the Person Model from PersonModel.wiki to person.py.
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
149 |