Thanks Doug, In my Django-app where I want to create a cache, I don't have a request parameter and I can not add it because I need to be compatible with a part of the framework itself.
I don't need to access that cache in the templates anywhere. I would like that my objects persists only per request, if that is possible. Thanks, regards Miguel 2010/10/9 Doug <dball...@gmail.com> > Why not just stick it on the request object? > > def myview(request): > request.mycache=MyCacheClass() > > then it's available everywhere the request object is. If you are > wanting something that can be used in a template tag without > explicitly passing the request object (or your cache object) in, you > probably want thread locals and a middleware to reset after each > time. I've had to do this a couple of times, and regretted in in all > but one (a template loader - we serve many sites from one fastcgi > instance and that was the only way I could think to map templates for > different sites). > > -- > 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.