I currently have a blog model:
class BlogPost(models.Model):
title = models.CharField(max_length=150)
body = models.TextField()
author = models.ForeignKey(User)
timestamp = models.DateTimeField()
Right now, author is returning the default User.username. I have
other models who has a ForeignKey to User, I want them to keep
defaulting to username while for Blogpost, I want it to return
"first_name last_name". How can I customize the above so that author
returns me "first_name last_name" if they are present?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---