Can Django's caching framework somehow be used to cache the output of
any function?

What I have right now is basically a standard Django project where
I've swapped out the templating engine and replaced it with Kid and
where I'm not using the supplied O-R mapper, but where I've written my
own DB layer.

The DB layer is basically just a db.py with each app that has a set of
functions for doing queries on the database. So I could do something
like:

from db import get_latest_books
books = get_latest_books(days=7)
blah.blah.output(template, books)

Some of the queries are rather expensive. Some might take a couple of
seconds to run. (There are 5.5 million books in the database...)

Does Django offer any decorators for caching the output of any
function, such as get_latest_books, based on the arguments passed to
it?

Or are there plans to include something like this? If not, then this
would be my request.


Elver

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to