mirror of
https://github.com/django/django.git
synced 2025-03-31 11:37:06 +00:00
Fixed #27587 -- Removing redundant str call
This commit is contained in:
parent
59ce6aa4a9
commit
336c409057
@ -478,7 +478,7 @@ Save these changes and start a new Python interactive shell by running
|
||||
<QuerySet [<Question: What's up?>]>
|
||||
# Print the SQL used to query the database
|
||||
>>> from pprint import pprint
|
||||
>>> pprint(str(q.query))
|
||||
>>> pprint(q.query)
|
||||
('SELECT "polls_question"."id", "polls_question"."question_text", '
|
||||
'"polls_question"."pub_date" FROM "polls_question"')
|
||||
|
||||
|
@ -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.
|
||||
|
||||
>>> 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
|
||||
look for unexpected clauses, etc. Note that this SQL may require modification
|
||||
|
Loading…
x
Reference in New Issue
Block a user