I have s.t like
class ModelA(SoftDeleteModel):
...
class ModelB(SoftDeleteModel):
model_a = models.OneToOneField(to=ModelA, on_delete=models.SET_NULL)
when I attempt to delete an instance of model a from the admin. It fails saying 'ModelA' object has no attribute '.all()'
this is b/c it is hitting this line
|
getattr(self, rel).all().update(**{x.remote_field.name: None}) |
instead of realizing that it is a reverse oneToOne field.
I have s.t like
when I attempt to delete an instance of model a from the admin. It fails saying
'ModelA' object has no attribute '.all()'this is b/c it is hitting this line
django-softdelete/softdelete/models.py
Line 253 in e9d6ee1
instead of realizing that it is a reverse oneToOne field.