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
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
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
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
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:
5 matches
Mail list logo