Matthias Kestenholz wrote:
> On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny<bar...@gorny.edu.pl> wrote:
>> Phil wrote:
>>> Hi Josh,
>>>
>>> unfortunately it seems that there is no way to do so. As you've
>>> noticed that correctly you can use request (request.user) in any place
>>> but model save.
>> Yes, I bumped into the same problem and came to the same conclusion. No
>> way. Unless you hack out something along the lines of
>> translation.activate/get_language - using a global dictionary and
>> current thread. It works, but is hardly in line with Django spirit.
>>
>> I think it is a design decision, to keep MVC structure clean. Though it
>> might be arguable if it would really seriously breach the MVC principle.
>> Maybe it is worthwhile.
>>
> 
> If you really need to do that (or if you are just extremely lazy)

I just don't like copy-and-paste programming. You can call it laziness, 
if you like.

> there is a cookbook recipe for achieving this sort of thing:
> 
> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

Yep, that's exactly what I did :)

> 
> That's deep in the category of 'give them rope to hang themselves
> with' though. You should understand the implications and design
> decisions involved before hacking your way around it.

I give +1 to Joshua's request - plz explain.

Bartek

> 
> Matthias
> 
> > 


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