Hi,

On Sun, May 17, 2009 at 10:59 PM, Thierry <lamthie...@gmail.com> wrote:
>
> I currently have a blog model:
>
> [BlogPost Model]
>
> 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 can create a proxy model to add new methods to the User model.
Description here:
http://docs.djangoproject.com/en/dev/topics/db/models/#proxy-models

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to