It asks what the use is of the .select_related in:
{{{
>>>
Entry.objects.select_related().filter(blog=b).update(headline='Everything
is the same')
}}}
To the best of my knowledge, there is no use of .select_reated in case of
a .update(..). Likely the ORM will ignore .select_related and
.prefetch_related calls, and if it does not, it can cause problems since
an UPDATE ... query with a JOIN ... clause results in problems about what
table to update and how.
It thus might be better to omit the .select_related() part here. Likely
this is due to copying from another part of the documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/32187>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
Yes, looks right.
--
Ticket URL: <https://code.djangoproject.com/ticket/32187#comment:1>
* owner: nobody => Hasan Ramezani
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32187#comment:2>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c448e614c60cc97c6194c62052363f4f501e0953" c448e61]:
{{{
#!CommitTicketReference repository=""
revision="c448e614c60cc97c6194c62052363f4f501e0953"
Fixed #32187 -- Removed unnecessary select_related in queries doc.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32187#comment:3>
Comment (by Carlton Gibson <carlton.gibson@…>):
In [changeset:"eba8d6f5d73ed315e4b89b6cb92db57c3906bd5d" eba8d6f]:
{{{
#!CommitTicketReference repository=""
revision="eba8d6f5d73ed315e4b89b6cb92db57c3906bd5d"
[3.1.x] Fixed #32187 -- Removed unnecessary select_related in queries doc.
Backport of c448e614c60cc97c6194c62052363f4f501e0953 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32187#comment:4>