summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2014-06-05 14:54:28 -0400
committerTim Graham <timograham@gmail.com>2014-06-05 15:14:14 -0400
commit4ad299f287e6b8bc4ccd0ecbbfd1efcf4aca8251 (patch)
tree748d69c52357cbbcd66204f05ea0c34ee6307643 /docs
parent342b25449d800ce29ae56ff8285869cbc3133a75 (diff)
[1.7.x] Fix missing highlighting in some code examples
Backport of 84cafc2b35 from master
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/db/queries.txt14
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
index 9d0663434d..7c1f50a87e 100644
--- a/docs/topics/db/queries.txt
+++ b/docs/topics/db/queries.txt
@@ -86,8 +86,8 @@ To save changes to an object that's already in the database, use
Given a ``Blog`` instance ``b5`` that has already been saved to the database,
this example changes its name and updates its record in the database::
- >> b5.name = 'New name'
- >> b5.save()
+ >>> b5.name = 'New name'
+ >>> b5.save()
This performs an ``UPDATE`` SQL statement behind the scenes. Django doesn't hit
the database until you explicitly call :meth:`~django.db.models.Model.save`.
@@ -249,9 +249,9 @@ stored, used and reused.
Example::
- >> q1 = Entry.objects.filter(headline__startswith="What")
- >> q2 = q1.exclude(pub_date__gte=datetime.date.today())
- >> q3 = q1.filter(pub_date__gte=datetime.date.today())
+ >>> q1 = Entry.objects.filter(headline__startswith="What")
+ >>> q2 = q1.exclude(pub_date__gte=datetime.date.today())
+ >>> q3 = q1.filter(pub_date__gte=datetime.date.today())
These three ``QuerySets`` are separate. The first is a base
:class:`~django.db.models.query.QuerySet` containing all entries that contain a
@@ -392,7 +392,9 @@ Basic lookups keyword arguments take the form ``field__lookuptype=value``.
>>> Entry.objects.filter(pub_date__lte='2006-01-01')
-translates (roughly) into the following SQL::
+translates (roughly) into the following SQL:
+
+.. code-block:: sql
SELECT * FROM blog_entry WHERE pub_date <= '2006-01-01';