#33500: Django ORM bug
-------------------------------------+-------------------------------------
Reporter: Bobosher | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have overloaded delete() method of my model to enable soft deletion so
that delete() method just sets is_deleted field to be true and calls
build-in save() method.
It's working fine against individual model objects:
{{{
my_object = MyModel.objects.get(id=1)
my_object.delete() # Works fine, the object isn't actually deleted.
}}}
But when I called delete() method directly for a queryset, it just hard-
deleted those objects included in the queryset:
{{{
some_objects = MyModel.objects.filter(id__lte=10)
some_objects.delete() # Those objects are actually deleted from the
database.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33500>
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/051.cc8b4d39c7f60fe634976173a351cc39%40djangoproject.com.