You're right Dougal, I *should* do that I have various apps already
working with the whole project trying to access object.user in general
and I was wondering if there was a clean way to alias author. I'm
already using some workarounds but it's dirty...


On Apr 20, 1:26 pm, Dougal Matthews <[email protected]> wrote:
> why don't you just access entry.author rather than entry.user?
> I think perhaps I'm not quite following your question.
>
> Dougal
>
> ---
> Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/
>
> 2009/4/20 Bastien <[email protected]>
>
>
>
>
>
> > Hi,
>
> > I searched the doc but couldn't find anything about this: I have a
> > model for a blog entry that contains a foreign key to user and is
> > named author. But that would be really convenient for me if the object
> > would respond to the keyword 'user' as well: entry.user doesn't exist
> > in the model but I would like it to return what entry.author usually
> > returns, just like an alias. Does anything like that exists in Django?
> > is it considered good practice? I could just use the author key or
> > rename it to user but what happens is that I have various applications
> > that already work with either object.user or object.author and I don't
> > want to rewrite them all. Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to