summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-04-28 18:02:01 +0200
committerClaude Paroz <claude@2xlibre.net>2012-04-30 20:45:03 +0200
commit596cb9c7e287abbb98c64974fb4944d522cb6b5a (patch)
treee8ad5402dd233458b392d1822146bb1102ba74a6 /docs/ref/models
parentfe43ad5707d116bb1729bc17a24ca16c90ae040d (diff)
Replaced print statement by print function (forward compatibility syntax).
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/instances.txt2
-rw-r--r--docs/ref/models/querysets.txt6
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 8eaf946825..3c84be50a6 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -327,7 +327,7 @@ Once the object has been saved, you must reload the object in order to access
the actual value that was applied to the updated field::
>>> product = Products.objects.get(pk=product.pk)
- >>> print product.number_sold
+ >>> print(product.number_sold)
42
For more details, see the documentation on :ref:`F() expressions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index b20c6e34e5..050598a532 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -29,7 +29,7 @@ You can evaluate a ``QuerySet`` in the following ways:
the headline of all entries in the database::
for e in Entry.objects.all():
- print e.headline
+ print(e.headline)
* **Slicing.** As explained in :ref:`limiting-querysets`, a ``QuerySet`` can
be sliced, using Python's array-slicing syntax. Slicing an unevaluated
@@ -71,7 +71,7 @@ You can evaluate a ``QuerySet`` in the following ways:
``True``, otherwise ``False``. For example::
if Entry.objects.filter(headline="Test"):
- print "There is at least one Entry with the headline Test"
+ print("There is at least one Entry with the headline Test")
Note: *Don't* use this if all you want to do is determine if at least one
result exists, and don't need the actual objects. It's more efficient to
@@ -1251,7 +1251,7 @@ The :exc:`~django.core.exceptions.DoesNotExist` exception inherits from
e = Entry.objects.get(id=3)
b = Blog.objects.get(id=1)
except ObjectDoesNotExist:
- print "Either the entry or blog doesn't exist."
+ print("Either the entry or blog doesn't exist.")
create
~~~~~~