Look into johnny-cache.

https://github.com/jmoiron/johnny-cache

--
Joey "JoeLinux" Espinosa
Python Developer
http://about.me/joelinux
On Jun 19, 2013 7:33 PM, "Kurtis" <kurtis.mull...@gmail.com> wrote:

> I could have sworn I've already asked this question but didn't see it in
> my search results. Anyways,
>
> I have a large set of calculations in my models. I'm trying to stick with
> the OOP style for future maintainers or whomever else has to work with the
> code. The problem is that I'm up to 100 queries on a single view. Many of
> these queries are duplicated. Others are very close to being duplicated
> except for the 'comparison key'. (e.g. where user = foo)
>
> I'm hoping there is some sort of mechanism out there to easily cache these
> DB calls on a per-query basis. The calculations themselves are incredibly
> intensive (relatively speaking) but 100 queries per view can easily turn
> into a nightmare if this project becomes popular.
>
> Is there any "out of the box" solutions to caching Query Sets within the
> scope of a single request? I am using a combination of class methods,
> instance methods, and in some places simple generic methods so I'm really
> pursuing a way to cache these at a lower level. These should only be cached
> for the duration of the request.
>
> I've seen some 'hackish' options and of course there are the larger ORM
> caching libraries but I'd like to find a clean solution without a whole lot
> of overhead.
>
> Thanks!
> - Kurtis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to