0

I have a Django model that refers to itself as below:

    parent = models.ForeignKey('self', ...)

I need to act in some situations as on_delete=models.CASCADE and in other situations as on_delete=models.DO_NOTHING. How can I do that?

1 Answers1

0

You can use on_delete=models.SET_NULL