Answer the question
In order to leave comments, you need to log in
Delete object via parent method?
There is a certain model in which the delete method is overridden. For example something like:
class SomeModel(SomeParent):
deleted = models.BooleanField(default=False)
def delete(self):
self.deleted = True
self.save()
>>> my_obj = SomeModel.object.get(pk=some_pk)
>>> my_obj.delete()
>>> 'parent' in dir(my_obj)
False
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question