diff options
| author | Timothy Allen <flipper@peregrinesalon.com> | 2016-10-31 15:22:32 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-10-31 15:23:14 -0400 |
| commit | 355917f7c4eb564537dcafd9a109e04e80e4be98 (patch) | |
| tree | 2985476b1590f1edc3bde8743e8c0fa3d03625c8 /docs | |
| parent | 052578879d4edf2c79b9c727e9458e4df8ffbff8 (diff) | |
[1.10.x] Updated docs/topics/db/queries.txt examples to use print() function.
Backport of 5595db9504ca3fe431f04f853ac8b71edac012c9 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/queries.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt index b1f1f2f746..ecbbf4ab6f 100644 --- a/docs/topics/db/queries.txt +++ b/docs/topics/db/queries.txt @@ -763,16 +763,16 @@ For example, repeatedly getting a certain index in a queryset object will query the database each time:: >>> queryset = Entry.objects.all() - >>> print queryset[5] # Queries the database - >>> print queryset[5] # Queries the database again + >>> print(queryset[5]) # Queries the database + >>> print(queryset[5]) # Queries the database again However, if the entire queryset has already been evaluated, the cache will be checked instead:: >>> queryset = Entry.objects.all() >>> [entry for entry in queryset] # Queries the database - >>> print queryset[5] # Uses cache - >>> print queryset[5] # Uses cache + >>> print(queryset[5]) # Uses cache + >>> print(queryset[5]) # Uses cache Here are some examples of other actions that will result in the entire queryset being evaluated and therefore populate the cache:: |
