QuerySet.delete() should return number of rows matched
|Reported by:||estebistec||Owned by:||estebistec|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||sergeykolosov, dev@…, zborboa-google||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||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 (20)
comment:1 Changed 4 years ago by estebistec
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to estebistec
- Patch needs improvement unset
comment:2 Changed 4 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 4 years ago by estebistec
comment:7 Changed 3 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 3 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
comment:16 Changed 23 months ago by timo
- Needs documentation set
- Needs tests set
- Patch needs improvement set
- Summary changed from [patch] queryset delete should return number of rows matched to QuerySet.delete() should return number of rows matched