Author: jezdez Date: 2010-02-21 17:39:08 -0600 (Sun, 21 Feb 2010) New Revision: 12462
Modified: django/trunk/docs/ref/models/querysets.txt Log: Fixed #12620 - Refer to better fieldname in defer docs. Thanks, dwillis. Modified: django/trunk/docs/ref/models/querysets.txt =================================================================== --- django/trunk/docs/ref/models/querysets.txt 2010-02-21 23:38:50 UTC (rev 12461) +++ django/trunk/docs/ref/models/querysets.txt 2010-02-21 23:39:08 UTC (rev 12462) @@ -820,7 +820,7 @@ This is done by passing the names of the fields to not load to ``defer()``:: - Entry.objects.defer("lede", "body") + Entry.objects.defer("headline", "body") A queryset that has deferred fields will still return model instances. Each deferred field will be retrieved from the database if you access that field @@ -830,7 +830,7 @@ deferred set:: # Defers both the body and lede fields. - Entry.objects.defer("body").filter(headline="Lennon").defer("lede") + Entry.objects.defer("body").filter(rating=5).defer("headline") The order in which fields are added to the deferred set does not matter. Calling ``defer()`` with a field name that has already been deferred is harmless (the field will still be deferred). @@ -838,7 +838,7 @@ loading via ``select_related()``) by using the standard double-underscore notation to separate related fields:: - Blog.objects.select_related().defer("entry__lede", "entry__body") + Blog.objects.select_related().defer("entry__headline", "entry__body") If you want to clear the set of deferred fields, pass ``None`` as a parameter to ``defer()``:: -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.