Malcolm,

I noticed this addition to the docs in django-updates:

+  Note that QuerySets are not callable, so
+  if you want to pass in a QuerySet in ``extra_context`` and have it
+  evaluated at render time, you need to wrap it in a function (that
+  returns the QuerySet).

I think this confuses the issue slightly - the fundamental problem is 
that QuerySets cache the data they get back from the db when you 
evaluate them.  Could I suggest something like this instead:

Note that QuerySets retrieve and cache their data when they are first 
evaluated, so if you want to pass in a QuerySet in ``extra_context`` 
that is always fresh you need to wrap it in a function or lambda that 
returns the QuerySet.

Thanks,

Luke

-- 
"Outside of a dog, a book is a man's best friend... inside of a dog, 
it's too dark to read."

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

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

Reply via email to