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))
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31258>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => worksforme
Comment:
Hi Pavel.
Can you put together a minimal project demonstrating this issue please?
When I test as best I can from the description on a project it's all
working as expected, so maybe there's more info needed to reproduce?
I'll close as "worksforme" for now, but if you can provide a test project,
please do re-open.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/31258#comment:1>