I attached a UserProfile class to User this way:
class UserProfile(models.Model):
url = models.URLField()
home_address = models.TextField()
user = models.ForeignKey(User, unique=True)
I have also implemented auto-creating of UserProfile if needed this way:
def user_post_save(sender, instance, signal, *args, **kwargs):
profile, new = UserProfile.objects.get_or_create(user=instance)
models.signals.post_save.connect(user_post_save, sender=User)
It works fine but I need a small feature - when I go to User Profiles in admin console, I see a list of UserProfiles for existing users. Their titles are shown as UserProfile object. I think it would be nice if I could set titles to corresponding user names, for example, john, kenny etc. How can I do that?