The name is really a poperty of the User. Not always having to retrieve the profile for that makes things simpler.
Signed-off-by: Damien Lespiau <[email protected]> --- patchwork/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/patchwork/models.py b/patchwork/models.py index a1d6840..8a0858b 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -20,6 +20,7 @@ from django.db import models from django.db.models import Q import django.dispatch +from django.contrib import auth from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.contrib.sites.models import Site @@ -86,6 +87,8 @@ def user_name(user): return u' '.join(names) return user.username +auth.models.User.add_to_class('name', user_name) + class UserProfile(models.Model): user = models.OneToOneField(User, unique = True, related_name='profile') primary_project = models.ForeignKey(Project, null = True, blank = True) -- 2.4.3 _______________________________________________ Patchwork mailing list [email protected] https://lists.ozlabs.org/listinfo/patchwork
