Am Dienstag, 8. Januar 2008 14:10 schrieb Alex Koshelev:
> Simpliest way is to patch model class at applications loading time:
>
> #somewhere in your own models.py file of some app
> from django.contrib.auth.models import User
>
> def user_unicode(self):
> return '%s: %s %s' % (self.username,
Simpliest way is to patch model class at applications loading time:
#somewhere in your own models.py file of some app
from django.contrib.auth.models import User
def user_unicode(self):
return '%s: %s %s' % (self.username, self.first_name,
self.last_name)
User.__unicode__ = user_unicode
On
I'd probably put it in my models file.
Michael
Thomas Guettler schrieb:
> Hi,
>
> our customer wants to display the username as 'username: firstname
> lastname'
>
> The easiest way would be to overwrite User.__unicode__. But where
> should you put code like this? Up to now I put it in our mid
3 matches
Mail list logo