diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-04-28 18:02:01 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-04-30 20:45:03 +0200 |
| commit | 596cb9c7e287abbb98c64974fb4944d522cb6b5a (patch) | |
| tree | e8ad5402dd233458b392d1822146bb1102ba74a6 /docs/topics/db/sql.txt | |
| parent | fe43ad5707d116bb1729bc17a24ca16c90ae040d (diff) | |
Replaced print statement by print function (forward compatibility syntax).
Diffstat (limited to 'docs/topics/db/sql.txt')
| -rw-r--r-- | docs/topics/db/sql.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt index 658dfdf859..2ac47170aa 100644 --- a/docs/topics/db/sql.txt +++ b/docs/topics/db/sql.txt @@ -40,7 +40,7 @@ This is best illustrated with an example. Suppose you've got the following model You could then execute custom SQL like so:: >>> for p in Person.objects.raw('SELECT * FROM myapp_person'): - ... print p + ... print(p) John Smith Jane Jones @@ -128,8 +128,8 @@ The ``Person`` objects returned by this query will be deferred model instances fields that are omitted from the query will be loaded on demand. For example:: >>> for p in Person.objects.raw('SELECT id, first_name FROM myapp_person'): - ... print p.first_name, # This will be retrieved by the original query - ... print p.last_name # This will be retrieved on demand + ... print(p.first_name, # This will be retrieved by the original query + ... p.last_name) # This will be retrieved on demand ... John Smith Jane Jones @@ -153,7 +153,7 @@ of people with their ages calculated by the database:: >>> people = Person.objects.raw('SELECT *, age(birth_date) AS age FROM myapp_person') >>> for p in people: - ... print "%s is %s." % (p.first_name, p.age) + ... print("%s is %s." % (p.first_name, p.age)) John is 37. Jane is 42. ... |
