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 django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---