Thursday, September 30, 2010

Change auth User display name in admin interface

I'm using the django User authentication.

I have a model that has a ManyToManyField which allows you to select
several users to associate with that model. In the django admin site,
it's set to use the filter_horizontal option.

When adding a new instance of the model through the admin interface,
it shows you the username of the User. I would like it to show the
first_name and last_name instead. I tried using a Proxy Model and
changing the __unicode__(self) with no success, it still shows the
username in the admin site. I also tried inheriting from the User
class, but it did not work either and I would rather not do it that
way.

I'm a relative noob at django, so I could very easily be missing
something simple. Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment