1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

Fixed #27587 -- Removing redundant str call

This commit is contained in:
Josiah White 2022-10-22 20:11:42 -07:00
parent 59ce6aa4a9
commit 336c409057
2 changed files with 2 additions and 2 deletions

View File

@ -478,7 +478,7 @@ Save these changes and start a new Python interactive shell by running
<QuerySet [<Question: What's up?>]> <QuerySet [<Question: What's up?>]>
# Print the SQL used to query the database # Print the SQL used to query the database
>>> from pprint import pprint >>> from pprint import pprint
>>> pprint(str(q.query)) >>> pprint(q.query)
('SELECT "polls_question"."id", "polls_question"."question_text", ' ('SELECT "polls_question"."id", "polls_question"."question_text", '
'"polls_question"."pub_date" FROM "polls_question"') '"polls_question"."pub_date" FROM "polls_question"')

View File

@ -344,7 +344,7 @@ When debugging a query, it may be useful to see the SQL generated by a
queryset. You may do this by converting the ``query`` attribute to a string. queryset. You may do this by converting the ``query`` attribute to a string.
>>> q = Entry.objects.all() >>> q = Entry.objects.all()
>>> str(q.query) >>> print(q.query)
This prints the SQL that is used to query the database. From there, you may This prints the SQL that is used to query the database. From there, you may
look for unexpected clauses, etc. Note that this SQL may require modification look for unexpected clauses, etc. Note that this SQL may require modification