Hi James,

On Feb 7, 1:09 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Feb 7, 2008 11:44 AM, Henhiskan <[EMAIL PROTECTED]> wrote:
>
> > > See:http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>
> > Thanks a lot, is exactly that I was looking for
>
> This is a really bad idea; in almost 100% of cases, it's better to be
> writing something in your view which reads request.user and hands it
> off to something else directly than it is to be messing around with
> threadlocals for this.

You are right, of course. But I think the OP's post falls in that
fractional percentage of cases where this is not such a bad idea. OP
quote "I try to get the name of the current user (logged in **admin
interface**) to use in the models.py" (** emphasis mine.)

If he's trying to get the logged in user instance in, say, his models
save() *and* he needs this to work from the Admin interface, he
doesn't have request.user available.

Cheers,
-Rajesh D
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to