On Fri, May 9, 2008 at 8:12 PM, Peter Rowell <[EMAIL PROTECTED]> wrote:
>
[snip]
>  In order to delay a *very* expensive DB operation, I decided to put it
>  in a function and pass the function as a context variable. The
>  template uses fragment caching with vary_on, so only if the template
>  fragment is stale would the function be called and invoke the heavy
>  lifting.
>
[snip]

QuearySets are lazy and, as I understand it, don't get evaluated until
they are called in the template. Therefore, if a quearyset call is
wrapped in an if statement in the template that evaluates to false,
the query should never happen. What are you trying to accomplish that
is any different?


On Fri, May 9, 2008 at 8:23 PM, Peter Rowell <[EMAIL PROTECTED]> wrote:
>
>  BTW, I tried to add a comment on this to 
> http://code.djangoproject.com/ticket/7153,
>  but got "Internal Server Error (Submission rejected as potential
>  spam)", which struck me as rather rude. :-)
>

Well, spam littered tickets would be worse. It's the lesser of two
evils. You can register [1] for an account and bypass the spam filter
-- Or, if you don't what to register, create a session [2] to get the
spam filter to go easy on you.

[1]: http://www.djangoproject.com/accounts/register/
[2]: http://code.djangoproject.com/settings



-- 
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to