app/soc/models/role.py
changeset 1131 9dd535241841
parent 1090 e4c2ccbeb25a
child 1132 046668855732
equal deleted inserted replaced
1130:9bdbb18d622e 1131:9dd535241841
    96       required=True,
    96       required=True,
    97       verbose_name=ugettext('Last (family) name'))
    97       verbose_name=ugettext('Last (family) name'))
    98   surname.help_text = ugettext('lower ASCII characters only')
    98   surname.help_text = ugettext('lower ASCII characters only')
    99 
    99 
   100   #: Optional field used as a display name, such as for awards
   100   #: Optional field used as a display name, such as for awards
   101   #: certificates. Should be the entire display name in the format
   101   #: certificates. Should be the entire name in the format
   102   #: the Role would like it displayed (could be surname followed by
   102   #: the Role would like it displayed (could be surname followed by
   103   #: given name in some cultures, for example). Display names can be
   103   #: given name in some cultures, for example). Display names can be
   104   #: any valid UTF-8 text.
   104   #: any valid UTF-8 text.
   105   display_name = db.StringProperty(
   105   name_on_certificates = db.StringProperty(
   106       verbose_name=ugettext('Display Name'))
   106       verbose_name=ugettext('Display Name'))
   107   display_name.help_text = ugettext(
   107   name_on_certificates.help_text = ugettext(
   108       'Optional field used as a display name, such as for awards '
   108       'Optional field used as a display name, such as for awards '
   109       'certificates. Should be the entire display name in the format '
   109       'certificates. Should be the entire name in the format '
   110       'the person would like it displayed (could be family name followed '
   110       'the person would like it displayed (could be family name followed '
   111       'by given name in some cultures, for example). Display names can be '
   111       'by given name in some cultures, for example). Display names can be '
   112       'any valid UTF-8 text.')
   112       'any valid UTF-8 text.')
   113 
   113 
   114   #====================================================================
   114   #====================================================================
   304   status.help_text = ugettext(
   304   status.help_text = ugettext(
   305       'Indicates the status of the role concerning which privileges may be used.')
   305       'Indicates the status of the role concerning which privileges may be used.')
   306 
   306 
   307 
   307 
   308   def name(self):
   308   def name(self):
   309     """Alias 'display_name' Property as 'name' for use in common templates.
   309     """Property as 'name' for use in common templates.
   310     """
   310     """
   311     return self.display_name
   311     if self.name_on_certificates:
       
   312       return self.name_on_certificates
       
   313     else:
       
   314       return '%s %s' (self.given_name, self.surname)