Add a CN attribute to pratic attributes

This commit is contained in:
Benjamin Dauvergne 2015-06-30 10:17:07 +02:00
parent 83b5373434
commit 85ba12f504
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ def get_attribute_names(instance, ctx):
if field.name == 'user_ptr':
continue
yield 'pratic_' + field.name, field.verbose_name
yield 'pratic_cn', 'Nom complet'
def get_dependencies(instance, ctx):
return ('user',)
@ -33,4 +34,5 @@ def get_attributes(instance, ctx):
if field.name == 'user_ptr':
continue
ctx['pratic_' + field.name] = getattr(user, field.name)
ctx['pratic_cn'] = user.first_name + ' ' + user.last_name
return ctx