hmm.. I wonder if there is a way for the django model API to do this automatically for you. and it would cache EVERYTHING for the given request.
On 12/1/05, Eric Baker <[EMAIL PROTECTED]> wrote: > > I wrote a custom tag that allows you to cache an expression in a > template. > > I noticed, that my template was sending many duplicate queries to the > database because I was using a method in my model that used a foreign > key in a loop with many repeats. > > I could have recoded the view to generate all the required data before > rendering the template, but chose to implement a caching mechanism for > the template instead. > > There seem to be pros and cons to both approaches. > > More details here: http://django.satilla.com/board/topic/2/ > > -- [EMAIL PROTECTED] -- blog: http://feh.holsman.net/ -- PH: ++61-3-9877-0909 If everything seems under control, you're not going fast enough. - Mario Andretti