Opened 5 years ago

Last modified 5 years ago

#31148 closed Cleanup/optimization

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

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

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(union_queryset.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 (0)

Note: See TracTickets for help on using tickets.
Back to Top