Below is my table :
class Project(models.Model):
name = models.CharField(max_length=100, null=False)
desc = models.CharField(max_length=100, null=False)
def __str__(self):
return self.name
class Activity(models.Model):
title = models.CharField(max_length=100, null=False)
project = models.ForeignKey(Project, on_delete=models.SET(some_func), null=False,
related_name='project_model')
So above is my table and when one of the datas of "project" table gets deleted then i want to assign "id or name" of the deleted "project" data to foreign key of the "activity" table. How can i achieve this? pls help.