Re: filter cache output

2011-07-15 Thread Rob
On Jul 15, 8:57 pm, Nan wrote: > Well, you can use one of the methods from [2] to force the queryset to > evaluate before caching it.  But you'll still run a new query in order > to filter, unless you aftually filter the data in your Python code. Very clear, thanks! -- You received this message

Re: filter cache output

2011-07-15 Thread Nan
Well, you can use one of the methods from [2] to force the queryset to evaluate before caching it. But you'll still run a new query in order to filter, unless you aftually filter the data in your Python code. On Jul 15, 2:46 pm, Rob wrote: > On Jul 15, 8:34 pm, Nan wrote: > > > Querysets are e

Re: filter cache output

2011-07-15 Thread Rob
On Jul 15, 8:34 pm, Nan wrote: > Querysets are evaluated lazily.[1][2]  You may have better success > using template fragment caching[3] to cache the menu output. > Thanks for the reply. I read the part about the "lazy" querysets and therefore I suspected the database not to be hit. This also do

Re: filter cache output

2011-07-15 Thread Nan
Querysets are evaluated lazily.[1][2] You may have better success using template fragment caching[3] to cache the menu output. [1] https://docs.djangoproject.com/en/dev/topics/db/queries/#querysets-are-lazy [3] https://docs.djangoproject.com/en/dev/ref/models/querysets/#when-querysets-are-evalu

filter cache output

2011-07-15 Thread Rob
I have setup caching with memcached for my site. This works well except from this part of my view. My idea was to store all menu items in the cache, and apply a filter later on to decide if they belong to the left or top menu. menu = cache.get(menu_cache_key) if menu: