Thanks again Doug,

I understand your method. I think the problem is that it might be too much
overhead for what I can gain using a cache, so I might drop the idea of
adding one. In any case, your explanation will be probably worth in future
projects :)

Regards,
Miguel

2010/10/10 Doug <dball...@gmail.com>

> Look around for python docs on threading.local, which lets you set a
> 'global' variable for just that thread.  Since a request is only going
> to happen in a single thread, that lets you have a per-request global
> that can be used for cache storage.  With middleware to set the
> threading local instance up, and remove it at the end of the request.
> I think it will do what you want.  One bit of weirdness I noticed was
> that you always need to import the global in exactly the same way
> everywhere you want it, otherwise you may not be referring to the same
> variable.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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