#9519: Add QuerySet.bulk_delete() that issues only a single SQL query
-------------------------------------+-------------------------------------
Reporter: Joey Wilhelm | Owner: Akash
| Kumar Sen
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database, queryset, | Triage Stage: Accepted
delete |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Akash Kumar Sen):
* cc: Akash Kumar Sen (added)
* owner: nobody => Akash Kumar Sen
* status: new => assigned
Comment:
https://docs.djangoproject.com/en/4.2/topics/db/queries/#topics-db-
queries-delete
As referred in the documentation,
{{{
Keep in mind that this will, whenever possible, be executed purely in SQL,
and so the delete() methods of individual object instances will not
necessarily be called during the process. If you’ve provided a custom
delete() method on a model class and want to ensure that it is called, you
will need to “manually” delete instances of that model (e.g., by iterating
over a QuerySet and calling delete() on each object individually) rather
than using the bulk delete() method of a QuerySet.
}}}
The current {{{delete()}}} method for a queryset already deletes objects
in bulk. Do we need another {{{bulk_update()}}} method for the same?
--
Ticket URL: <https://code.djangoproject.com/ticket/9519#comment:32>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018850d351d7-fb9353b0-c5e6-4b8f-9771-38252e24f4b6-000000%40eu-central-1.amazonses.com.