I'm not sure I see the use case here; it only works when the code to
calculate the expensive value can be fit into a single statement, and
(in my experience at least) that's not usually how things work.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
You of course wouldn't /have/ to use a lambda, you could pass in
whatever function you wanted. lambda is just for example purposes.
For the sake of discussion, there is a ticket with similar goals, but
only for QuerySets:
#5 - Add a cache=NUM_SECONDS argument to QuerySet
http://code.djangoproject.com/ticket/5