#9519: Add QuerySet.bulk_delete() that issues only a single SQL query
-------------------------------------+-------------------------------------
     Reporter:  Tarken               |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  database, queryset,  |      Needs documentation:  0
  delete                             |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by carljm):

 I consider inheritance to be a different case from cascade (both in
 concept, because you have a conceptually single object that spans rows in
 multiple tables, and in that it's implemented as a special case, the only
 case where you might 'cascade' in the reverse direction across an
 FK/OneToOne).

 I could see perhaps implementing something like (3) for inheritance only,
 not for other cascades. Though I'm just as happy not allowing
 `bulk_delete` in inheritance cases.

 In any case, I don't think the behavior charettes was hoping for is
 preferable. `bulk_delete` should either delete both parent and child rows
 in inheritance cases, or it should refuse to do anything at all. Deleting
 child rows only violates the inheritance abstraction. It should either
 just be done in raw SQL, or if it's really got convincing use-cases it
 should get a more explicit API, not occur as a surprising side-effect of
 `bulk_delete`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/9519#comment:25>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to