Hello, I have overloaded delete() method of my model to enable soft 
deletion so that delete() method just sets is_seleted field to be True.
When calling this method for individual objects, it works fine.
But when I called delete() method directly for a queryset (for example, 
MyModel.objects.filter(id__lte=10).delete(), it just hard-deleted those 
objects and not called my custom delete() method.

Please, let me know if it's a bug or not.
If it isn't, please let me know how to do this in a better way.
Now, my temporary solution is iterating through selected objects and call 
delete() method for each.

I've tested this on 2 versions of django: 1.11 and 3.2

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users/6db418c3-3c65-400f-bd6c-d89bc1c4aab2n%40googlegroups.com.

Reply via email to