Opened 7 years ago
Closed 7 years ago
#28820 closed Bug (fixed)
update() produces extra query with proxy model
Description ¶
Assume we have these models:
class Chef(models.Model): name = models.CharField(max_length=50) class Meta: db_table = "chef" class ProxyChef(Chef): class Meta: proxy = True
If we execute update query on proxy
ProxyChef.objects.filter(id=1).update(name='William')
We get two queries
SELECT "chef"."id" FROM "chef" WHERE "chef"."id" = 1 UPDATE "chef" SET "name" = 'William' WHERE "chef"."id" IN (1)
The first one is totally unnecessary.
Change History (3)
comment:1 by , 7 years ago
Owner: | changed from | to
---|
comment:2 by , 7 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
PR