#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 tobias):

 I like the new logic in 1.5, but I still think you should be able to apply
 the `DO_NOTHING` logic on a per-query basis, rather than having to use
 whatever policy you set in the `ForeignKey` declaration across the project
 as a whole.  For example, if I know I'm going to be deleting millions of
 rows, I'll want to enable this, but for normal use at just about every
 other point in my project, the default behavior is preferable.  Could we
 just add something like a `force_fast` option to the `delete()` method
 that basically did the same thing as having `DO_NOTHING` on every foreign
 key in the model being deleted?

 For others who stumble upon this ticket and wonder how the new code in 1.5
 works, here's a link to the docs:

 
https://docs.djangoproject.com/en/1.5/ref/models/querysets/#django.db.models.query.QuerySet.delete

-- 
Ticket URL: <https://code.djangoproject.com/ticket/9519#comment:27>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.622a96ae974b86012f2d7963d51019a2%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to