Commit 01aeb59d authored by fred.perso's avatar fred.perso

Merge branch 'contrib_jbd' into 'master'

pretty observer name instead of created_by name

See merge request !10
parents c01ff2c8 328f755d
...@@ -115,6 +115,15 @@ class Profile(AbstractBaseUser, PermissionsMixin): ...@@ -115,6 +115,15 @@ class Profile(AbstractBaseUser, PermissionsMixin):
"Returns the short name for the user." "Returns the short name for the user."
return self.first_name return self.first_name
@property
def name_pretty(self):
"If lastname exists, return firstname initial and lastname. Else return username."
if self.last_name :
first=self.first_name or ' '
return '{} {}'.format(first[0]+'.',self.last_name).strip(' .')
else :
return self.username
def __str__(self): def __str__(self):
return self.username return self.username
......
...@@ -1375,7 +1375,7 @@ class SightingTable(tables.Table): ...@@ -1375,7 +1375,7 @@ class SightingTable(tables.Table):
fields = ( fields = (
'id','actions', 'common_name_fr', 'sci_name','sp_true', 'total_count', 'breed_colo', 'session', 'study', 'session.date_start', 'id','actions', 'common_name_fr', 'sci_name','sp_true', 'total_count', 'breed_colo', 'session', 'study', 'session.date_start',
'period', 'session.contact.descr', 'place', 'placetype', 'municipality','export_placetype', 'export_municipality', 'export_territory', 'export_x', 'export_y', 'period', 'session.contact.descr', 'place', 'placetype', 'municipality','export_placetype', 'export_municipality', 'export_territory', 'export_x', 'export_y',
'created_by', 'comment', 'export_comment') 'observer.name_pretty', 'comment', 'export_comment')
class SightingExportTable(tables.Table): class SightingExportTable(tables.Table):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment