> > As I did some other experiments, it seems to me, that there are
> > TWO '_thread_locals' objects, one filled in 'process_request' (which
> > has 'user' attribute set) and another one in 'get_current_user' which
> > does not.

The problem was in the fact, that i had 
import middleware.threadlocals
in models.py, but 
'MY_APP.middleware.threadlocals.ThreadLocals',
in settings.py in MIDDLEWARE_CLASSES


So this was TWO different names for the same modul and even if it get loaded, 
then the '_thread_local' variable was not the same (comes from TWO different 
modules), so it got TWO different values depending on what way it was used. 
(and "Python threading.local() is NOT a singleton")

So I used literally the same names in both places and everything works ...

-- 
Zdravi
     Gilhad
     [EMAIL PROTECTED]

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