app/soc/models/role.py
changeset 1410 20580c5272e4
parent 1407 423425ac79f5
child 1420 c49d6f79663d
equal deleted inserted replaced
1409:6a7350c320f2 1410:20580c5272e4
    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 
    91 
    91   #: Required field storing the parts of the Role's name
    92   #: Required field storing the parts of the Role's name
    92   #: corresponding to the field names; displayed publicly.
    93   #: corresponding to the field names; displayed publicly.
    93   #: 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
    94   #: used, for example, as part of the shipping (mailing) address.
    95   #: used, for example, as part of the shipping (mailing) address.
    95   surname = db.StringProperty(
    96   surname = db.StringProperty(
    96       required=True,
    97       required=True,
    97       verbose_name=ugettext('Last (family) name'))
    98       verbose_name=ugettext('Last (family) name'))
    98   surname.help_text = ugettext('lower ASCII characters only')
    99   surname.help_text = ugettext('lower ASCII characters only')
       
   100   surname.group=ugettext("1. Public Info")
    99 
   101 
   100   #: Optional field used as a display name, such as for awards
   102   #: Optional field used as a display name, such as for awards
   101   #: certificates. Should be the entire name in the format
   103   #: certificates. Should be the entire name in the format
   102   #: the Role would like it displayed (could be surname followed by
   104   #: the Role would like it displayed (could be surname followed by
   103   #: given name in some cultures, for example). Display names can be
   105   #: given name in some cultures, for example). Display names can be
   108       'Optional field used as a display name, such as for documents like '
   110       'Optional field used as a display name, such as for documents like '
   109       'awards certificates. Should be the entire name in the format '
   111       'awards certificates. Should be the entire name in the format '
   110       'the person would like it displayed (could be family name followed '
   112       'the person would like it displayed (could be family name followed '
   111       'by given name in some cultures, for example). Name on documents can be '
   113       'by given name in some cultures, for example). Name on documents can be '
   112       'any valid UTF-8 text.')
   114       'any valid UTF-8 text.')
       
   115   name_on_documents.group=ugettext("1. Public Info")
   113 
   116 
   114   #====================================================================
   117   #====================================================================
   115   #  (public) contact information
   118   #  (public) contact information
   116   #====================================================================
   119   #====================================================================
   117 
   120 
   119   #: Role (as opposed to the user.account email address which is
   122   #: Role (as opposed to the user.account email address which is
   120   #: kept secret).
   123   #: kept secret).
   121   email = db.EmailProperty(
   124   email = db.EmailProperty(
   122       required=True,
   125       required=True,
   123       verbose_name=ugettext('Email Address'))
   126       verbose_name=ugettext('Email Address'))
       
   127   email.group=ugettext("1. Public Info")
   124 
   128 
   125   #: Optional field storing Instant Messaging network; displayed publicly.
   129   #: Optional field storing Instant Messaging network; displayed publicly.
   126   im_network = db.StringProperty(
   130   im_network = db.StringProperty(
   127       verbose_name=ugettext('IM Network'))
   131       verbose_name=ugettext('IM Network'))
   128   im_network.help_text = ugettext(
   132   im_network.help_text = ugettext(
   129       'examples: irc:irc.freenode.org xmpp:gmail.com/Home')
   133       'examples: irc:irc.freenode.org xmpp:gmail.com/Home')
       
   134   im_network.group=ugettext("1. Public Info")
   130 
   135 
   131   #: Optional field storing Instant Messaging handle; displayed publicly.
   136   #: Optional field storing Instant Messaging handle; displayed publicly.
   132   im_handle = db.StringProperty(
   137   im_handle = db.StringProperty(
   133       verbose_name=ugettext('IM Handle'))
   138       verbose_name=ugettext('IM Handle'))
   134   im_handle.help_text = ugettext(
   139   im_handle.help_text = ugettext(
   135       '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")
   136 
   142 
   137   #: Optional field storing a home page URL; displayed publicly.
   143   #: Optional field storing a home page URL; displayed publicly.
   138   home_page = db.LinkProperty(
   144   home_page = db.LinkProperty(
   139       verbose_name=ugettext('Home Page URL'))
   145       verbose_name=ugettext('Home Page URL'))
       
   146   home_page.group=ugettext("1. Public Info")
   140 
   147 
   141   #: Optional field storing a blog URL; displayed publicly.
   148   #: Optional field storing a blog URL; displayed publicly.
   142   blog = db.LinkProperty(
   149   blog = db.LinkProperty(
   143       verbose_name=ugettext('Blog URL'))
   150       verbose_name=ugettext('Blog URL'))
       
   151   blog.group=ugettext("1. Public Info")
   144 
   152 
   145   #: 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
   146   #: personal photo (or cartoon avatar, perhaps); displayed publicly.
   154   #: personal photo (or cartoon avatar, perhaps); displayed publicly.
   147   photo_url = db.LinkProperty(
   155   photo_url = db.LinkProperty(
   148       verbose_name=ugettext('Thumbnail Photo URL'))
   156       verbose_name=ugettext('Thumbnail Photo URL'))
   149   photo_url.help_text = ugettext(
   157   photo_url.help_text = ugettext(
   150       'URL of 64x64 pixel thumbnail image')
   158       'URL of 64x64 pixel thumbnail image')
       
   159   photo_url.group=ugettext("1. Public Info")
   151 
   160 
   152   #: Optional field storing the latitude provided by the Role; displayed
   161   #: Optional field storing the latitude provided by the Role; displayed
   153   #: publicly.
   162   #: publicly.
   154   latitude = db.FloatProperty(
   163   latitude = db.FloatProperty(
   155       verbose_name=ugettext('Latitude'))
   164       verbose_name=ugettext('Latitude'))
   156   latitude.help_text = ugettext(
   165   latitude.help_text = ugettext(
   157       '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")
   158 
   168 
   159   #: Optional field storing the longitude provided by the Role; displayed
   169   #: Optional field storing the longitude provided by the Role; displayed
   160   #: publicly.
   170   #: publicly.
   161   longitude = db.FloatProperty(
   171   longitude = db.FloatProperty(
   162       verbose_name=ugettext('Longitude'))
   172       verbose_name=ugettext('Longitude'))
   163   longitude.help_text = ugettext(
   173   longitude.help_text = ugettext(
   164       '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")
   165 
   176 
   166   #====================================================================
   177   #====================================================================
   167   # (private) contact information
   178   # (private) contact information
   168   #====================================================================
   179   #====================================================================
   169 
   180 
   172   #: it may be used as a shipping address.
   183   #: it may be used as a shipping address.
   173   res_street = db.StringProperty(required=True,
   184   res_street = db.StringProperty(required=True,
   174       verbose_name=ugettext('Street address'))
   185       verbose_name=ugettext('Street address'))
   175   res_street.help_text = ugettext(
   186   res_street.help_text = ugettext(
   176       'street number and name, lower ASCII characters only')
   187       'street number and name, lower ASCII characters only')
   177   res_street.group=ugettext("2. Contact Info")
   188   res_street.group=ugettext("2. Contact Info (Private)")
   178 
   189 
   179   #: Required field containing residence address city; kept private.
   190   #: Required field containing residence address city; kept private.
   180   #: 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
   181   #: may be used as a shipping address.
   192   #: may be used as a shipping address.
   182   res_city = db.StringProperty(required=True,
   193   res_city = db.StringProperty(required=True,
   183       verbose_name=ugettext('City'))
   194       verbose_name=ugettext('City'))
   184   res_city.help_text = ugettext('lower ASCII characters only')
   195   res_city.help_text = ugettext('lower ASCII characters only')
   185   res_city.group=ugettext("2. Contact Info")
   196   res_city.group=ugettext("2. Contact Info (Private)")
   186 
   197 
   187   #: Optional field containing residence address state or province; kept
   198   #: Optional field containing residence address state or province; kept
   188   #: 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
   189   #: text, because it may be used as a shipping address.
   200   #: text, because it may be used as a shipping address.
   190   res_state = db.StringProperty(
   201   res_state = db.StringProperty(
   191       verbose_name=ugettext('State/Province'))
   202       verbose_name=ugettext('State/Province'))
   192   res_state.help_text = ugettext(
   203   res_state.help_text = ugettext(
   193       'optional if country/territory does not have states or provinces, '
   204       'optional if country/territory does not have states or provinces, '
   194       'lower ASCII characters only')
   205       'lower ASCII characters only')
   195   res_state.group=ugettext("2. Contact Info")
   206   res_state.group=ugettext("2. Contact Info (Private)")
   196 
   207 
   197   #: Required field containing residence address country or territory; kept
   208   #: Required field containing residence address country or territory; kept
   198   #: private.
   209   #: private.
   199   res_country = db.StringProperty(required=True,
   210   res_country = db.StringProperty(required=True,
   200       verbose_name=ugettext('Country/Territory'),
   211       verbose_name=ugettext('Country/Territory'),
   201       choices=countries.COUNTRIES_AND_TERRITORIES)
   212       choices=countries.COUNTRIES_AND_TERRITORIES)
   202   res_country.group=ugettext("2. Contact Info")
   213   res_country.group=ugettext("2. Contact Info (Private)")
   203 
   214 
   204   #: Required field containing residence address postal code (ZIP code in
   215   #: Required field containing residence address postal code (ZIP code in
   205   #: the United States); kept private.  Residence postal code can only be
   216   #: the United States); kept private.  Residence postal code can only be
   206   #: 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.
   207   res_postalcode = db.StringProperty(required=True,
   218   res_postalcode = db.StringProperty(required=True,
   208       verbose_name=ugettext('ZIP/Postal Code'))
   219       verbose_name=ugettext('ZIP/Postal Code'))
   209   res_postalcode.help_text = ugettext('lower ASCII characters only')
   220   res_postalcode.help_text = ugettext('lower ASCII characters only')
   210   res_postalcode.group=ugettext("2. Contact Info")
   221   res_postalcode.group=ugettext("2. Contact Info (Private)")
       
   222 
       
   223   #: Required field containing a phone number that will be used to
       
   224   #: contact the user, also supplied to shippers; kept private.
       
   225   phone = db.PhoneNumberProperty(
       
   226       required=True,
       
   227       verbose_name=ugettext('Phone Number'))
       
   228   phone.help_text = ugettext(
       
   229       'include complete international calling number with country code')
       
   230   phone.group=ugettext("2. Contact Info (Private)")
   211 
   231 
   212   #: field storing whether the User has agreed to publish his location
   232   #: field storing whether the User has agreed to publish his location
   213   publish_location = db.BooleanProperty(required=False, default=False,
   233   publish_location = db.BooleanProperty(required=False, default=False,
   214       verbose_name=ugettext('Publish my location'))
   234       verbose_name=ugettext('Publish my location'))
   215   publish_location.help_text = ugettext(
   235   publish_location.help_text = ugettext(
   216       'Indicates whether the user agreed to publish location.')
   236       'Indicates whether the user agreed to publish location.')
   217   publish_location.group=ugettext("3. Contact Info")
   237   publish_location.group=ugettext("2. Contact Info (Private)")
   218 
   238 
   219   #: Optional field containing a separate shipping street address; kept
   239   #: Optional field containing a separate shipping street address; kept
   220   #: private.  If shipping address is not present in its entirety, the
   240   #: private.  If shipping address is not present in its entirety, the
   221   #: residence address will be used instead.  Shipping street address can only
   241   #: residence address will be used instead.  Shipping street address can only
   222   #: 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
   223   #: shipping address.
   243   #: shipping address.
   224   ship_street = db.StringProperty(
   244   ship_street = db.StringProperty(
   225       verbose_name=ugettext('Shipping Street address'))
   245       verbose_name=ugettext('Shipping Street address'))
   226   ship_street.help_text = ugettext(
   246   ship_street.help_text = ugettext(
   227       'street number and name, lower ASCII characters only')
   247       'street number and name, lower ASCII characters only, '
   228   ship_street.group=ugettext("4. Shipping Info")
   248       'fill in only if not same as above')
       
   249   ship_street.group=ugettext("3. Shipping Info (Private and Optional)")
   229 
   250 
   230   #: Optional field containing shipping address city; kept private.
   251   #: Optional field containing shipping address city; kept private.
   231   #: 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
   232   #: supplied, it is used as a shipping address.
   253   #: supplied, it is used as a shipping address.
   233   ship_city = db.StringProperty(
   254   ship_city = db.StringProperty(
   234       verbose_name=ugettext('Shipping City'))
   255       verbose_name=ugettext('Shipping City'))
   235   ship_city.help_text = ugettext('lower ASCII characters only')
   256   ship_city.help_text = ugettext('lower ASCII characters only'
   236   ship_city.group=ugettext("4. Shipping Info")
   257                                  'fill in only if not same as above')
       
   258   ship_city.group=ugettext("3. Shipping Info (Private and Optional)")
   237 
   259 
   238   #: Optional field containing shipping address state or province; kept
   260   #: Optional field containing shipping address state or province; kept
   239   #: 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
   240   #: text, because, if supplied, it is used as a shipping address.
   262   #: text, because, if supplied, it is used as a shipping address.
   241   ship_state = db.StringProperty(
   263   ship_state = db.StringProperty(
   242       verbose_name=ugettext('Shipping State/Province'))
   264       verbose_name=ugettext('Shipping State/Province'))
   243   ship_state.help_text = ugettext(
   265   ship_state.help_text = ugettext(
   244       'optional if country/territory does not have states or provinces, '
   266       'optional if country/territory does not have states or provinces, '
   245       'lower ASCII characters only')
   267       'lower ASCII characters only, fill in only if not same as above')
   246   ship_state.group=ugettext("4. Shipping Info")
   268   ship_state.group=ugettext("3. Shipping Info (Private and Optional)")
   247 
   269 
   248   #: Optional field containing shipping address country or territory; kept
   270   #: Optional field containing shipping address country or territory; kept
   249   #: private.
   271   #: private.
   250   ship_country = db.StringProperty(
   272   ship_country = db.StringProperty(
   251       verbose_name=ugettext('Shipping Country/Territory'),
   273       verbose_name=ugettext('Shipping Country/Territory'),
   252       choices=countries.COUNTRIES_AND_TERRITORIES)
   274       choices=countries.COUNTRIES_AND_TERRITORIES)
   253   ship_country.group=ugettext("4. Shipping Info")
   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)")
   254 
   277 
   255   #: Optional field containing shipping address postal code (ZIP code in
   278   #: Optional field containing shipping address postal code (ZIP code in
   256   #: the United States); kept private.  Shipping postal code can only be
   279   #: the United States); kept private.  Shipping postal code can only be
   257   #: 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
   258   #: shipping address.
   281   #: shipping address.
   259   ship_postalcode = db.StringProperty(
   282   ship_postalcode = db.StringProperty(
   260       verbose_name=ugettext('Shipping ZIP/Postal Code'))
   283       verbose_name=ugettext('Shipping ZIP/Postal Code'))
   261   ship_postalcode.help_text = ugettext('lower ASCII characters only')
   284   ship_postalcode.help_text = ugettext('lower ASCII characters only'
   262   ship_postalcode.group=ugettext("4. Shipping Info (Optional)")
   285                                        'fill in only if not same as above')
   263 
   286   ship_postalcode.group=ugettext("3. Shipping Info (Private and Optional)")
   264   #: Required field containing a phone number that will be supplied
       
   265   #: to shippers; kept private.
       
   266   phone = db.PhoneNumberProperty(
       
   267       required=True,
       
   268       verbose_name=ugettext('Phone Number'))
       
   269   phone.help_text = ugettext(
       
   270       'include complete international calling number with country code')
       
   271   phone.group=ugettext("4. Shipping Info")
       
   272   
   287   
   273 
   288 
   274   #====================================================================
   289   #====================================================================
   275   # (private) personal information
   290   # (private) personal information
   276   #====================================================================
   291   #====================================================================
   280   birth_date = db.DateProperty(
   295   birth_date = db.DateProperty(
   281       required=True,
   296       required=True,
   282       verbose_name=ugettext('Birth Date'))
   297       verbose_name=ugettext('Birth Date'))
   283   birth_date.help_text = ugettext(
   298   birth_date.help_text = ugettext(
   284       'required for determining program eligibility')
   299       'required for determining program eligibility')
   285   birth_date.group=ugettext("5. Private Info")
   300   birth_date.group=ugettext("4. Private Info")
   286 
   301 
   287   #: Optional field indicating choice of t-shirt, from XXS to XXXL;
   302   #: Optional field indicating choice of t-shirt, from XXS to XXXL;
   288   #: kept private.
   303   #: kept private.
   289   tshirt_size = db.StringProperty(
   304   tshirt_size = db.StringProperty(
   290       verbose_name=ugettext('T-shirt Size'),
   305       verbose_name=ugettext('T-shirt Size'),
   291       choices=('XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'))
   306       choices=('XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'))
   292   tshirt_size.group=ugettext("5. Private Info")
   307   tshirt_size.group=ugettext("4. Private Info")
   293 
   308 
   294   #: Optional field indicating choice of t-shirt fit; kept private.
   309   #: Optional field indicating choice of t-shirt fit; kept private.
   295   tshirt_style = db.StringProperty(
   310   tshirt_style = db.StringProperty(
   296       verbose_name=ugettext('T-shirt Style'),
   311       verbose_name=ugettext('T-shirt Style'),
   297       choices=('male', 'female'))
   312       choices=('male', 'female'))
   298   tshirt_style.group=ugettext("5. Private Info")
   313   tshirt_style.group=ugettext("4. Private Info")
   299 
   314 
   300   #: 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.
   301   #: (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
   302   #: when the first User profile is created when bootstrapping the site.)
   317   #: when the first User profile is created when bootstrapping the site.)
   303   agreed_to_tos = db.BooleanProperty(required=False, default=False,
   318   agreed_to_tos = db.BooleanProperty(required=False, default=False,
   304       verbose_name=ugettext('I Agree to the Terms of Service'))
   319       verbose_name=ugettext('I Agree to the Terms of Service'))
   305   agreed_to_tos.help_text = ugettext(
   320   agreed_to_tos.help_text = ugettext(
   306       'Indicates whether the user agreed to this role Terms of Service.')
   321       'Indicates whether the user agreed to this role Terms of Service.')
   307   agreed_to_tos.group=ugettext("6. Terms of Service")
   322   agreed_to_tos.group=ugettext("5. Terms of Service")
   308 
   323 
   309   #: 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.
   310   #: (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
   311   #: when the first User profile is created when bootstrapping the site.)
   326   #: when the first User profile is created when bootstrapping the site.)
   312   agreed_to_tos_on = db.DateTimeProperty(required=False, default=None,
   327   agreed_to_tos_on = db.DateTimeProperty(required=False, default=None,
   313       verbose_name=ugettext('Has agreed to the Terms of Service on'))
   328       verbose_name=ugettext('Has agreed to the Terms of Service on'))
   314   agreed_to_tos_on.help_text = ugettext(
   329   agreed_to_tos_on.help_text = ugettext(
   315       'Indicates when the user agreed to this role Terms of Service.')
   330       'Indicates when the user agreed to this role Terms of Service.')
   316   agreed_to_tos.group=ugettext("6. Terms of Service")
   331   agreed_to_tos.group=ugettext("5. Terms of Service")
   317 
   332 
   318   #: field storing the status of this role
   333   #: field storing the status of this role
   319   #: Active means that this role can exercise all it's privileges.
   334   #: Active means that this role can exercise all it's privileges.
   320   #: Invalid mean that this role cannot exercise it's privileges.
   335   #: Invalid mean that this role cannot exercise it's privileges.
   321   #: Inactive means that this role cannot exercise it's data-editing
   336   #: Inactive means that this role cannot exercise it's data-editing