85 #: given_name can only be lower ASCII, not UTF-8 text, because it is |
85 #: given_name can only be lower ASCII, not UTF-8 text, because it is |
86 #: used, for example, as part of the shipping (mailing) address. |
86 #: used, for example, as part of the shipping (mailing) address. |
87 given_name = db.StringProperty(required=True, |
87 given_name = db.StringProperty(required=True, |
88 verbose_name=ugettext('First (given) name')) |
88 verbose_name=ugettext('First (given) name')) |
89 given_name.help_text = ugettext('lower ASCII characters only') |
89 given_name.help_text = ugettext('lower ASCII characters only') |
90 given_name.group=ugettext("1. Public Info") |
90 given_name.group = ugettext("1. Public Info") |
91 |
91 |
92 #: Required field storing the parts of the Role's name |
92 #: Required field storing the parts of the Role's name |
93 #: corresponding to the field names; displayed publicly. |
93 #: corresponding to the field names; displayed publicly. |
94 #: Surname can only be lower ASCII, not UTF-8 text, because it is |
94 #: Surname can only be lower ASCII, not UTF-8 text, because it is |
95 #: used, for example, as part of the shipping (mailing) address. |
95 #: used, for example, as part of the shipping (mailing) address. |
96 surname = db.StringProperty( |
96 surname = db.StringProperty( |
97 required=True, |
97 required=True, |
98 verbose_name=ugettext('Last (family) name')) |
98 verbose_name=ugettext('Last (family) name')) |
99 surname.help_text = ugettext('lower ASCII characters only') |
99 surname.help_text = ugettext('lower ASCII characters only') |
100 surname.group=ugettext("1. Public Info") |
100 surname.group = ugettext("1. Public Info") |
101 |
101 |
102 #: Optional field used as a display name, such as for awards |
102 #: Optional field used as a display name, such as for awards |
103 #: certificates. Should be the entire name in the format |
103 #: certificates. Should be the entire name in the format |
104 #: the Role would like it displayed (could be surname followed by |
104 #: the Role would like it displayed (could be surname followed by |
105 #: given name in some cultures, for example). Display names can be |
105 #: given name in some cultures, for example). Display names can be |
122 #: Role (as opposed to the user.account email address which is |
122 #: Role (as opposed to the user.account email address which is |
123 #: kept secret). |
123 #: kept secret). |
124 email = db.EmailProperty( |
124 email = db.EmailProperty( |
125 required=True, |
125 required=True, |
126 verbose_name=ugettext('Email Address')) |
126 verbose_name=ugettext('Email Address')) |
127 email.group=ugettext("1. Public Info") |
127 email.group = ugettext("1. Public Info") |
128 |
128 |
129 #: Optional field storing Instant Messaging network; displayed publicly. |
129 #: Optional field storing Instant Messaging network; displayed publicly. |
130 im_network = db.StringProperty( |
130 im_network = db.StringProperty( |
131 verbose_name=ugettext('IM Network')) |
131 verbose_name=ugettext('IM Network')) |
132 im_network.help_text = ugettext( |
132 im_network.help_text = ugettext( |
133 'examples: irc:irc.freenode.net xmpp:gmail.com/Home') |
133 'examples: irc:irc.freenode.net xmpp:gmail.com/Home') |
134 im_network.group=ugettext("1. Public Info") |
134 im_network.group = ugettext("1. Public Info") |
135 |
135 |
136 #: Optional field storing Instant Messaging handle; displayed publicly. |
136 #: Optional field storing Instant Messaging handle; displayed publicly. |
137 im_handle = db.StringProperty( |
137 im_handle = db.StringProperty( |
138 verbose_name=ugettext('IM Handle')) |
138 verbose_name=ugettext('IM Handle')) |
139 im_handle.help_text = ugettext( |
139 im_handle.help_text = ugettext( |
140 'personal identifier, such as: screen name, IRC nick, user name') |
140 'personal identifier, such as: screen name, IRC nick, user name') |
141 im_handle.group=ugettext("1. Public Info") |
141 im_handle.group = ugettext("1. Public Info") |
142 |
142 |
143 #: Optional field storing a home page URL; displayed publicly. |
143 #: Optional field storing a home page URL; displayed publicly. |
144 home_page = db.LinkProperty( |
144 home_page = db.LinkProperty( |
145 verbose_name=ugettext('Home Page URL')) |
145 verbose_name=ugettext('Home Page URL')) |
146 home_page.group=ugettext("1. Public Info") |
146 home_page.group = ugettext("1. Public Info") |
147 |
147 |
148 #: Optional field storing a blog URL; displayed publicly. |
148 #: Optional field storing a blog URL; displayed publicly. |
149 blog = db.LinkProperty( |
149 blog = db.LinkProperty( |
150 verbose_name=ugettext('Blog URL')) |
150 verbose_name=ugettext('Blog URL')) |
151 blog.group=ugettext("1. Public Info") |
151 blog.group = ugettext("1. Public Info") |
152 |
152 |
153 #: Optional field storing a URL to an image, expected to be a |
153 #: Optional field storing a URL to an image, expected to be a |
154 #: personal photo (or cartoon avatar, perhaps); displayed publicly. |
154 #: personal photo (or cartoon avatar, perhaps); displayed publicly. |
155 photo_url = db.LinkProperty( |
155 photo_url = db.LinkProperty( |
156 verbose_name=ugettext('Thumbnail Photo URL')) |
156 verbose_name=ugettext('Thumbnail Photo URL')) |
157 photo_url.help_text = ugettext( |
157 photo_url.help_text = ugettext( |
158 'URL of 64x64 pixel thumbnail image') |
158 'URL of 64x64 pixel thumbnail image') |
159 photo_url.group=ugettext("1. Public Info") |
159 photo_url.group = ugettext("1. Public Info") |
160 |
160 |
161 #: Optional field storing the latitude provided by the Role; displayed |
161 #: Optional field storing the latitude provided by the Role; displayed |
162 #: publicly. |
162 #: publicly. |
163 latitude = db.FloatProperty( |
163 latitude = db.FloatProperty( |
164 verbose_name=ugettext('Latitude')) |
164 verbose_name=ugettext('Latitude')) |
165 latitude.help_text = ugettext( |
165 latitude.help_text = ugettext( |
166 'decimal degrees northerly (N), use minus sign (-) for southerly (S)') |
166 'decimal degrees northerly (N), use minus sign (-) for southerly (S)') |
167 latitude.group=ugettext("1. Public Info") |
167 latitude.group = ugettext("1. Public Info") |
168 |
168 |
169 #: Optional field storing the longitude provided by the Role; displayed |
169 #: Optional field storing the longitude provided by the Role; displayed |
170 #: publicly. |
170 #: publicly. |
171 longitude = db.FloatProperty( |
171 longitude = db.FloatProperty( |
172 verbose_name=ugettext('Longitude')) |
172 verbose_name=ugettext('Longitude')) |
173 longitude.help_text = ugettext( |
173 longitude.help_text = ugettext( |
174 'decimal degrees easterly (E), use minus sign (-) for westerly (W)') |
174 'decimal degrees easterly (E), use minus sign (-) for westerly (W)') |
175 longitude.group=ugettext("1. Public Info") |
175 longitude.group = ugettext("1. Public Info") |
176 |
176 |
177 #==================================================================== |
177 #==================================================================== |
178 # (private) contact information |
178 # (private) contact information |
179 #==================================================================== |
179 #==================================================================== |
180 |
180 |
183 #: it may be used as a shipping address. |
183 #: it may be used as a shipping address. |
184 res_street = db.StringProperty(required=True, |
184 res_street = db.StringProperty(required=True, |
185 verbose_name=ugettext('Street address')) |
185 verbose_name=ugettext('Street address')) |
186 res_street.help_text = ugettext( |
186 res_street.help_text = ugettext( |
187 'street number and name, lower ASCII characters only') |
187 'street number and name, lower ASCII characters only') |
188 res_street.group=ugettext("2. Contact Info (Private)") |
188 res_street.group = ugettext("2. Contact Info (Private)") |
189 |
189 |
190 #: Required field containing residence address city; kept private. |
190 #: Required field containing residence address city; kept private. |
191 #: Residence city can only be lower ASCII, not UTF-8 text, because it |
191 #: Residence city can only be lower ASCII, not UTF-8 text, because it |
192 #: may be used as a shipping address. |
192 #: may be used as a shipping address. |
193 res_city = db.StringProperty(required=True, |
193 res_city = db.StringProperty(required=True, |
194 verbose_name=ugettext('City')) |
194 verbose_name=ugettext('City')) |
195 res_city.help_text = ugettext('lower ASCII characters only') |
195 res_city.help_text = ugettext('lower ASCII characters only') |
196 res_city.group=ugettext("2. Contact Info (Private)") |
196 res_city.group = ugettext("2. Contact Info (Private)") |
197 |
197 |
198 #: Optional field containing residence address state or province; kept |
198 #: Optional field containing residence address state or province; kept |
199 #: private. Residence state/province can only be lower ASCII, not UTF-8 |
199 #: private. Residence state/province can only be lower ASCII, not UTF-8 |
200 #: text, because it may be used as a shipping address. |
200 #: text, because it may be used as a shipping address. |
201 res_state = db.StringProperty( |
201 res_state = db.StringProperty( |
202 verbose_name=ugettext('State/Province')) |
202 verbose_name=ugettext('State/Province')) |
203 res_state.help_text = ugettext( |
203 res_state.help_text = ugettext( |
204 'optional if country/territory does not have states or provinces, ' |
204 'optional if country/territory does not have states or provinces, ' |
205 'lower ASCII characters only') |
205 'lower ASCII characters only') |
206 res_state.group=ugettext("2. Contact Info (Private)") |
206 res_state.group = ugettext("2. Contact Info (Private)") |
207 |
207 |
208 #: Required field containing residence address country or territory; kept |
208 #: Required field containing residence address country or territory; kept |
209 #: private. |
209 #: private. |
210 res_country = db.StringProperty(required=True, |
210 res_country = db.StringProperty(required=True, |
211 verbose_name=ugettext('Country/Territory'), |
211 verbose_name=ugettext('Country/Territory'), |
212 choices=countries.COUNTRIES_AND_TERRITORIES) |
212 choices=countries.COUNTRIES_AND_TERRITORIES) |
213 res_country.group=ugettext("2. Contact Info (Private)") |
213 res_country.group = ugettext("2. Contact Info (Private)") |
214 |
214 |
215 #: Required field containing residence address postal code (ZIP code in |
215 #: Required field containing residence address postal code (ZIP code in |
216 #: the United States); kept private. Residence postal code can only be |
216 #: the United States); kept private. Residence postal code can only be |
217 #: lower ASCII, not UTF-8 text, because it may be used as a shipping address. |
217 #: lower ASCII, not UTF-8 text, because it may be used as a shipping address. |
218 res_postalcode = db.StringProperty(required=True, |
218 res_postalcode = db.StringProperty(required=True, |
219 verbose_name=ugettext('ZIP/Postal Code')) |
219 verbose_name=ugettext('ZIP/Postal Code')) |
220 res_postalcode.help_text = ugettext('lower ASCII characters only') |
220 res_postalcode.help_text = ugettext('lower ASCII characters only') |
221 res_postalcode.group=ugettext("2. Contact Info (Private)") |
221 res_postalcode.group = ugettext("2. Contact Info (Private)") |
222 |
222 |
223 #: Required field containing a phone number that will be used to |
223 #: Required field containing a phone number that will be used to |
224 #: contact the user, also supplied to shippers; kept private. |
224 #: contact the user, also supplied to shippers; kept private. |
225 phone = db.PhoneNumberProperty( |
225 phone = db.PhoneNumberProperty( |
226 required=True, |
226 required=True, |
227 verbose_name=ugettext('Phone Number')) |
227 verbose_name=ugettext('Phone Number')) |
228 phone.help_text = ugettext( |
228 phone.help_text = ugettext( |
229 'include complete international calling number with country code') |
229 'include complete international calling number with country code') |
230 phone.group=ugettext("2. Contact Info (Private)") |
230 phone.group = ugettext("2. Contact Info (Private)") |
231 |
231 |
232 #: field storing whether the User has agreed to publish his location |
232 #: field storing whether the User has agreed to publish his location |
233 publish_location = db.BooleanProperty(required=False, default=False, |
233 publish_location = db.BooleanProperty(required=False, default=False, |
234 verbose_name=ugettext('Publish my location')) |
234 verbose_name=ugettext('Publish my location')) |
235 publish_location.help_text = ugettext( |
235 publish_location.help_text = ugettext( |
236 'Indicates whether the user agreed to publish location.') |
236 'Indicates whether the user agreed to publish location.') |
237 publish_location.group=ugettext("2. Contact Info (Private)") |
237 publish_location.group = ugettext("2. Contact Info (Private)") |
238 |
238 |
239 #: Optional field containing a separate shipping street address; kept |
239 #: Optional field containing a separate shipping street address; kept |
240 #: private. If shipping address is not present in its entirety, the |
240 #: private. If shipping address is not present in its entirety, the |
241 #: residence address will be used instead. Shipping street address can only |
241 #: residence address will be used instead. Shipping street address can only |
242 #: be lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
242 #: be lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
244 ship_street = db.StringProperty( |
244 ship_street = db.StringProperty( |
245 verbose_name=ugettext('Shipping Street address')) |
245 verbose_name=ugettext('Shipping Street address')) |
246 ship_street.help_text = ugettext( |
246 ship_street.help_text = ugettext( |
247 'street number and name, lower ASCII characters only, ' |
247 'street number and name, lower ASCII characters only, ' |
248 'fill in only if not same as above') |
248 'fill in only if not same as above') |
249 ship_street.group=ugettext("3. Shipping Info (Private and Optional)") |
249 ship_street.group = ugettext("3. Shipping Info (Private and Optional)") |
250 |
250 |
251 #: Optional field containing shipping address city; kept private. |
251 #: Optional field containing shipping address city; kept private. |
252 #: Shipping city can only be lower ASCII, not UTF-8 text, because, if |
252 #: Shipping city can only be lower ASCII, not UTF-8 text, because, if |
253 #: supplied, it is used as a shipping address. |
253 #: supplied, it is used as a shipping address. |
254 ship_city = db.StringProperty( |
254 ship_city = db.StringProperty( |
255 verbose_name=ugettext('Shipping City')) |
255 verbose_name=ugettext('Shipping City')) |
256 ship_city.help_text = ugettext('lower ASCII characters only' |
256 ship_city.help_text = ugettext('lower ASCII characters only' |
257 'fill in only if not same as above') |
257 'fill in only if not same as above') |
258 ship_city.group=ugettext("3. Shipping Info (Private and Optional)") |
258 ship_city.group = ugettext("3. Shipping Info (Private and Optional)") |
259 |
259 |
260 #: Optional field containing shipping address state or province; kept |
260 #: Optional field containing shipping address state or province; kept |
261 #: private. Shipping state/province can only be lower ASCII, not UTF-8 |
261 #: private. Shipping state/province can only be lower ASCII, not UTF-8 |
262 #: text, because, if supplied, it is used as a shipping address. |
262 #: text, because, if supplied, it is used as a shipping address. |
263 ship_state = db.StringProperty( |
263 ship_state = db.StringProperty( |
264 verbose_name=ugettext('Shipping State/Province')) |
264 verbose_name=ugettext('Shipping State/Province')) |
265 ship_state.help_text = ugettext( |
265 ship_state.help_text = ugettext( |
266 'optional if country/territory does not have states or provinces, ' |
266 'optional if country/territory does not have states or provinces, ' |
267 'lower ASCII characters only, fill in only if not same as above') |
267 'lower ASCII characters only, fill in only if not same as above') |
268 ship_state.group=ugettext("3. Shipping Info (Private and Optional)") |
268 ship_state.group = ugettext("3. Shipping Info (Private and Optional)") |
269 |
269 |
270 #: Optional field containing shipping address country or territory; kept |
270 #: Optional field containing shipping address country or territory; kept |
271 #: private. |
271 #: private. |
272 ship_country = db.StringProperty( |
272 ship_country = db.StringProperty( |
273 verbose_name=ugettext('Shipping Country/Territory'), |
273 verbose_name=ugettext('Shipping Country/Territory'), |
274 choices=countries.COUNTRIES_AND_TERRITORIES) |
274 choices=countries.COUNTRIES_AND_TERRITORIES) |
275 ship_country.help_text=ugettext('fill in only if not same as above') |
275 ship_country.help_text = ugettext('fill in only if not same as above') |
276 ship_country.group=ugettext("3. Shipping Info (Private and Optional)") |
276 ship_country.group = ugettext("3. Shipping Info (Private and Optional)") |
277 |
277 |
278 #: Optional field containing shipping address postal code (ZIP code in |
278 #: Optional field containing shipping address postal code (ZIP code in |
279 #: the United States); kept private. Shipping postal code can only be |
279 #: the United States); kept private. Shipping postal code can only be |
280 #: lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
280 #: lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
281 #: shipping address. |
281 #: shipping address. |
282 ship_postalcode = db.StringProperty( |
282 ship_postalcode = db.StringProperty( |
283 verbose_name=ugettext('Shipping ZIP/Postal Code')) |
283 verbose_name=ugettext('Shipping ZIP/Postal Code')) |
284 ship_postalcode.help_text = ugettext('lower ASCII characters only' |
284 ship_postalcode.help_text = ugettext('lower ASCII characters only' |
285 'fill in only if not same as above') |
285 'fill in only if not same as above') |
286 ship_postalcode.group=ugettext("3. Shipping Info (Private and Optional)") |
286 ship_postalcode.group = ugettext("3. Shipping Info (Private and Optional)") |
287 |
287 |
288 |
288 |
289 #==================================================================== |
289 #==================================================================== |
290 # (private) personal information |
290 # (private) personal information |
291 #==================================================================== |
291 #==================================================================== |
295 birth_date = db.DateProperty( |
295 birth_date = db.DateProperty( |
296 required=True, |
296 required=True, |
297 verbose_name=ugettext('Birth Date')) |
297 verbose_name=ugettext('Birth Date')) |
298 birth_date.help_text = ugettext( |
298 birth_date.help_text = ugettext( |
299 'required for determining program eligibility') |
299 'required for determining program eligibility') |
300 birth_date.group=ugettext("4. Private Info") |
300 birth_date.group = ugettext("4. Private Info") |
301 |
301 |
302 #: Optional field indicating choice of t-shirt, from XXS to XXXL; |
302 #: Optional field indicating choice of t-shirt, from XXS to XXXL; |
303 #: kept private. |
303 #: kept private. |
304 tshirt_size = db.StringProperty( |
304 tshirt_size = db.StringProperty( |
305 verbose_name=ugettext('T-shirt Size'), |
305 verbose_name=ugettext('T-shirt Size'), |
306 choices=('XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL')) |
306 choices=('XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL')) |
307 tshirt_size.group=ugettext("4. Private Info") |
307 tshirt_size.group = ugettext("4. Private Info") |
308 |
308 |
309 #: Optional field indicating choice of t-shirt fit; kept private. |
309 #: Optional field indicating choice of t-shirt fit; kept private. |
310 tshirt_style = db.StringProperty( |
310 tshirt_style = db.StringProperty( |
311 verbose_name=ugettext('T-shirt Style'), |
311 verbose_name=ugettext('T-shirt Style'), |
312 choices=('male', 'female')) |
312 choices=('male', 'female')) |
313 tshirt_style.group=ugettext("4. Private Info") |
313 tshirt_style.group = ugettext("4. Private Info") |
314 |
314 |
315 #: field storing wheter the User has agreed to the site-wide Terms of Service. |
315 #: field storing wheter the User has agreed to the site-wide Terms of Service. |
316 #: (Not a required field because the Terms of Service might not be present |
316 #: (Not a required field because the Terms of Service might not be present |
317 #: when the first User profile is created when bootstrapping the site.) |
317 #: when the first User profile is created when bootstrapping the site.) |
318 agreed_to_tos = db.BooleanProperty(required=False, default=False, |
318 agreed_to_tos = db.BooleanProperty(required=False, default=False, |
319 verbose_name=ugettext('I Agree to the Terms of Service')) |
319 verbose_name=ugettext('I Agree to the Terms of Service')) |
320 agreed_to_tos.help_text = ugettext( |
320 agreed_to_tos.help_text = ugettext( |
321 'Indicates whether the user agreed to this role Terms of Service.') |
321 'Indicates whether the user agreed to this role Terms of Service.') |
322 agreed_to_tos.group=ugettext("5. Terms of Service") |
322 agreed_to_tos.group = ugettext("5. Terms of Service") |
323 |
323 |
324 #: field storing when the User has agreed to the site-wide Terms of Service. |
324 #: field storing when the User has agreed to the site-wide Terms of Service. |
325 #: (Not a required field because the Terms of Service might not be present |
325 #: (Not a required field because the Terms of Service might not be present |
326 #: when the first User profile is created when bootstrapping the site.) |
326 #: when the first User profile is created when bootstrapping the site.) |
327 agreed_to_tos_on = db.DateTimeProperty(required=False, default=None, |
327 agreed_to_tos_on = db.DateTimeProperty(required=False, default=None, |
328 verbose_name=ugettext('Has agreed to the Terms of Service on')) |
328 verbose_name=ugettext('Has agreed to the Terms of Service on')) |
329 agreed_to_tos_on.help_text = ugettext( |
329 agreed_to_tos_on.help_text = ugettext( |
330 'Indicates when the user agreed to this role Terms of Service.') |
330 'Indicates when the user agreed to this role Terms of Service.') |
331 agreed_to_tos.group=ugettext("5. Terms of Service") |
331 agreed_to_tos.group = ugettext("5. Terms of Service") |
332 |
332 |
333 #: field storing the status of this role |
333 #: field storing the status of this role |
334 #: Active means that this role can exercise all it's privileges. |
334 #: Active means that this role can exercise all it's privileges. |
335 #: Invalid mean that this role cannot exercise it's privileges. |
335 #: Invalid mean that this role cannot exercise it's privileges. |
336 #: Inactive means that this role cannot exercise it's data-editing |
336 #: Inactive means that this role cannot exercise it's data-editing |
338 #: has been marked inactive an Organization Admin should still be able to see |
338 #: has been marked inactive an Organization Admin should still be able to see |
339 #: the student applications. |
339 #: the student applications. |
340 status = db.StringProperty(default='active', |
340 status = db.StringProperty(default='active', |
341 choices=['active','invalid','inactive'], |
341 choices=['active','invalid','inactive'], |
342 verbose_name=ugettext('Status of this Role')) |
342 verbose_name=ugettext('Status of this Role')) |
343 status.help_text = ugettext( |
343 status.help_text = ugettext('Indicates the status of the role ' |
344 'Indicates the status of the role concerning which privileges may be used.') |
344 'concerning which privileges may be used.') |
345 |
345 |
346 def name(self): |
346 def name(self): |
347 """Property as 'name' for use in common templates. |
347 """Property as 'name' for use in common templates. |
348 """ |
348 """ |
349 if self.name_on_documents: |
349 if self.name_on_documents: |
350 return self.name_on_documents |
350 return self.name_on_documents |
351 else: |
351 else: |
352 return '%s %s' %(self.given_name, self.surname) |
352 return '%s %s' % (self.given_name, self.surname) |