﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31258	Django admin deletes only one instance from many	Pavel-Y	nobody	"This is my first bug report here, hope I don't mess things too much.

I have this model. I have plenty of instances with the same name, same start_date and is_deleted=true. Also one instance with same name, same start_date but is_deleted=false.

When I go to admin page, mark _all_ those where is_deleted==true and delete them, I am asked if I am sure I want to delete. I answer Yes and I am returned to the previous page, to the list of instances. However only one of those instances is deleted. 

I think it's a bug. I think all marked instances should be deleted.
Django 2.2.10, python 3.6.4

{{{
class Festival(models.Model):
    name = models.CharField(max_length=100)
    start_date = models.DateField(null=True)
    is_deleted = models.BooleanField(default=False)

    def __str__(self):
        return self.name

    def __lt__(self, rhs):
        if self.start_date is None:
            return False
        if rhs.start_date is None: 
            return True
        return (self.start_date < rhs.start_date
            or self.start_date == rhs.start_date and self.name < rhs.name)

    def __eq__(self, rhs):
        return (self.start_date == rhs.start_date
            and self.name == rhs.name
            and self.is_deleted == rhs.is_deleted)

    def __hash__(self):
        return hash((self.name, self.start_date, self.is_deleted))

}}}
"	Bug	closed	contrib.admin	2.2	Normal	worksforme	admin		Unreviewed	0	0	0	0	0	0
