73 #: exist unassociated from a login identity and credentials. The |
73 #: exist unassociated from a login identity and credentials. The |
74 #: back-reference in the User model is a Query named 'roles'. |
74 #: back-reference in the User model is a Query named 'roles'. |
75 user = db.ReferenceProperty(reference_class=soc.models.user.User, |
75 user = db.ReferenceProperty(reference_class=soc.models.user.User, |
76 required=True, collection_name='roles') |
76 required=True, collection_name='roles') |
77 |
77 |
78 #: field storing whether User has agreed to the Role-specific Terms of |
|
79 #: Service. (Not a required field because some Roles may not have special |
|
80 #: Terms of Service.) |
|
81 agrees_to_tos = db.BooleanProperty( |
|
82 verbose_name=ugettext_lazy('Agrees to ToS')) |
|
83 agrees_to_tos.help_text = ugettext_lazy( |
|
84 'Indicates that the user agrees to the Terms of Service for this Role.') |
|
85 |
78 |
86 #==================================================================== |
79 #==================================================================== |
87 # (public) name information |
80 # (public) name information |
88 #==================================================================== |
81 #==================================================================== |
89 |
82 |
215 #: private. If shipping address is not present in its entirety, the |
208 #: private. If shipping address is not present in its entirety, the |
216 #: residence address will be used instead. Shipping street address can only |
209 #: residence address will be used instead. Shipping street address can only |
217 #: be lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
210 #: be lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
218 #: shipping address. |
211 #: shipping address. |
219 ship_street = db.StringProperty( |
212 ship_street = db.StringProperty( |
220 verbose_name=ugettext_lazy('Street address')) |
213 verbose_name=ugettext_lazy('Shipping Street address')) |
221 ship_street.help_text = ugettext_lazy( |
214 ship_street.help_text = ugettext_lazy( |
222 'street number and name, lower ASCII characters only') |
215 'street number and name, lower ASCII characters only') |
223 |
216 |
224 #: Optional field containing shipping address city; kept private. |
217 #: Optional field containing shipping address city; kept private. |
225 #: Shipping city can only be lower ASCII, not UTF-8 text, because, if |
218 #: Shipping city can only be lower ASCII, not UTF-8 text, because, if |
226 #: supplied, it is used as a shipping address. |
219 #: supplied, it is used as a shipping address. |
227 ship_city = db.StringProperty( |
220 ship_city = db.StringProperty( |
228 verbose_name=ugettext_lazy('City')) |
221 verbose_name=ugettext_lazy('Shipping City')) |
229 ship_city.help_text = ugettext_lazy('lower ASCII characters only') |
222 ship_city.help_text = ugettext_lazy('lower ASCII characters only') |
230 |
223 |
231 #: Optional field containing shipping address state or province; kept |
224 #: Optional field containing shipping address state or province; kept |
232 #: private. Shipping state/province can only be lower ASCII, not UTF-8 |
225 #: private. Shipping state/province can only be lower ASCII, not UTF-8 |
233 #: text, because, if supplied, it is used as a shipping address. |
226 #: text, because, if supplied, it is used as a shipping address. |
234 ship_state = db.StringProperty( |
227 ship_state = db.StringProperty( |
235 verbose_name=ugettext_lazy('State/Province')) |
228 verbose_name=ugettext_lazy('Shipping State/Province')) |
236 ship_state.help_text = ugettext_lazy( |
229 ship_state.help_text = ugettext_lazy( |
237 'optional if country/territory does not have states or provinces, ' |
230 'optional if country/territory does not have states or provinces, ' |
238 'lower ASCII characters only') |
231 'lower ASCII characters only') |
239 |
232 |
240 #: Optional field containing shipping address country or territory; kept |
233 #: Optional field containing shipping address country or territory; kept |
241 #: private. |
234 #: private. |
242 ship_country = db.StringProperty( |
235 ship_country = db.StringProperty( |
243 verbose_name=ugettext_lazy('Country/Territory'), |
236 verbose_name=ugettext_lazy('Shipping Country/Territory'), |
244 choices=countries.COUNTRIES_AND_TERRITORIES) |
237 choices=countries.COUNTRIES_AND_TERRITORIES) |
245 |
238 |
246 #: Optional field containing shipping address postal code (ZIP code in |
239 #: Optional field containing shipping address postal code (ZIP code in |
247 #: the United States); kept private. Shipping postal code can only be |
240 #: the United States); kept private. Shipping postal code can only be |
248 #: lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
241 #: lower ASCII, not UTF-8 text, because, if supplied, it is used as a |
249 #: shipping address. |
242 #: shipping address. |
250 ship_postalcode = db.StringProperty( |
243 ship_postalcode = db.StringProperty( |
251 verbose_name=ugettext_lazy('ZIP/Postal Code')) |
244 verbose_name=ugettext_lazy('Shipping ZIP/Postal Code')) |
252 ship_postalcode.help_text = ugettext_lazy('lower ASCII characters only') |
245 ship_postalcode.help_text = ugettext_lazy('lower ASCII characters only') |
253 |
246 |
254 #: Required field containing a phone number that will be supplied |
247 #: Required field containing a phone number that will be supplied |
255 #: to shippers; kept private. |
248 #: to shippers; kept private. |
256 phone = db.PhoneNumberProperty( |
249 phone = db.PhoneNumberProperty( |
279 |
272 |
280 #: Optional field indicating choice of t-shirt fit; kept private. |
273 #: Optional field indicating choice of t-shirt fit; kept private. |
281 tshirt_style = db.StringProperty( |
274 tshirt_style = db.StringProperty( |
282 verbose_name=ugettext_lazy('T-shirt Style'), |
275 verbose_name=ugettext_lazy('T-shirt Style'), |
283 choices=('male', 'female')) |
276 choices=('male', 'female')) |
|
277 |
|
278 #: field storing whether User has agreed to the Role-specific Terms of |
|
279 #: Service. (Not a required field because some Roles may not have special |
|
280 #: Terms of Service.) |
|
281 agrees_to_tos = db.BooleanProperty( |
|
282 verbose_name=ugettext_lazy('Agrees to ToS')) |
|
283 agrees_to_tos.help_text = ugettext_lazy( |
|
284 'Indicates that the user agrees to the Terms of Service for this Role.') |
284 |
285 |
285 def name(self): |
286 def name(self): |
286 """Alias 'display_name' Property as 'name' for use in common templates. |
287 """Alias 'display_name' Property as 'name' for use in common templates. |
287 """ |
288 """ |
288 return self.display_name |
289 return self.display_name |