QuerySet.delete() should return number of rows matched
|Reported by:||estebistec||Owned by:||estebistec|
|Component:||Database layer (models, ORM)||Version:||1.3|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||yes|
Description (last modified by carljm)
Splitting this off from ticket #16549...
Deep in the bowels of django.db the rows modified value from update and delete queries is ignored and discarded. For reasons discussed on ticket 16549, it would sometimes be useful to have access to that value.
Objective of this bug is to passively return rows-modified up through the call-stack and, ultimately, hopefully from each of:
with consideration for transaction control/mgmt.
Update from comment thread: queryset update already returns rows-matched (and this can't be changed to rows-changed without breaking other things). So it is only deletes that need this change.
Change History (17)
comment:1 Changed 3 years ago by estebistec
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to estebistec
- Patch needs improvement unset
comment:2 Changed 3 years ago by carljm
- Component changed from Uncategorized to Database layer (models, ORM)
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to New feature
Changed 2 years ago by estebistec
comment:7 Changed 2 years ago by estebistec
- Summary changed from Delete/update should return number of rows modified to [patch] Delete/update should return number of rows modified
comment:14 Changed 2 years ago by carljm
- Description modified (diff)
- Summary changed from [patch] Delete/update should return number of rows modified to [patch] queryset delete should return number of rows matched