Example: <class 'tuple'>: (2, {'my_app.FileAccess': 1, 'my_app.File': 1})
When there are zero objects to delete in total - the result is
inconsistent:
- For models with foreign keys - the result will be: <class 'tuple'>: (0,
{})
- For "simple" models without foreign key - the result will be: <class
'tuple'>: (0, {'my_app.BlockLibrary': 0})
I would expect there will be no difference between the two cases: Either
both will have the empty dictionary OR both will have dictionary with
model-label keys and zero value.
--
Ticket URL: <https://code.djangoproject.com/ticket/31474>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:1>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:2>
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
I guess we could adapt the code not to include any key if the count is
zero in the second case.
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:3>
* owner: nobody => Hasan Ramezani
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"35a67b3731dab2b546b3ed4d7f2deff529465c34" 35a67b37]:
{{{
#!CommitTicketReference repository=""
revision="35a67b3731dab2b546b3ed4d7f2deff529465c34"
Fixed #31474 -- Made QuerySet.delete() not return the number of deleted
objects if it's zero.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31474#comment:6>