Author: lukeplant
Date: 2010-08-28 06:30:28 -0500 (Sat, 28 Aug 2010)
New Revision: 13653
Modified:
django/branches/releases/1.2.X/
django/branches/releases/1.2.X/docs/ref/models/querysets.txt
Log:
[1.2.X] Fixed #14185 - improved example SQL for 'select' example.
Thanks to Trindaz for the suggestion.
Also fixed some references to 'lede' which is no longer part of the
example Blog model.
Backport of [13652] from trunk.
Property changes on: django/branches/releases/1.2.X
___________________________________________________________________
Name: svnmerge-integrated
- /django/trunk:1-13360,13434,13480,13574,13600,13638
+ /django/trunk:1-13360,13434,13480,13574,13600,13638,13652
Modified: django/branches/releases/1.2.X/docs/ref/models/querysets.txt
===================================================================
--- django/branches/releases/1.2.X/docs/ref/models/querysets.txt
2010-08-28 11:23:54 UTC (rev 13652)
+++ django/branches/releases/1.2.X/docs/ref/models/querysets.txt
2010-08-28 11:30:28 UTC (rev 13653)
@@ -703,9 +703,10 @@
greater than Jan. 1, 2006.
Django inserts the given SQL snippet directly into the ``SELECT``
- statement, so the resulting SQL of the above example would be::
+ statement, so the resulting SQL of the above example would be something
+ like::
- SELECT blog_entry.*, (pub_date > '2006-01-01')
+ SELECT blog_entry.*, (pub_date > '2006-01-01') AS is_recent
FROM blog_entry;
@@ -859,7 +860,7 @@
You can make multiple calls to ``defer()``. Each call adds new fields to the
deferred set::
- # Defers both the body and lede fields.
+ # Defers both the body and headline fields.
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).
@@ -919,7 +920,7 @@
result in only the final fields being considered::
# This will defer all fields except the headline.
- Entry.objects.only("body", "lede").only("headline")
+ Entry.objects.only("body", "rating").only("headline")
Since ``defer()`` acts incrementally (adding fields to the deferred list), you
can combine calls to ``only()`` and ``defer()`` and things will behave
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.