Opened 5 years ago

Last modified 5 years ago

#31148 closed Cleanup/optimization

Can not update unioned queryset after union. — at Version 1

Reported by: Joon Hwan 김준환 Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Hasan Ramezani Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Joon Hwan 김준환)

b_filter() seems to merge but does not apply to the actual update

q = M.objects.none()
q = q.union(M.objects.a_filter())
print(q)
q = q.union(M.objects.b_filter())
print(q)
print(str(q.update(name='foo').query))
<QuerySet [<M: M object (675)>]>
<QuerySet [<M: M object (675)>, <M: M object (773)>]>
UPDATE "m" SET "name" = "foo" WHERE `a_filter Conditional statement` ORDER BY U0."id" ASC  LIMIT 1); args=(...)

Change History (1)

comment:1 by Joon Hwan 김준환, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top