xxxxxxxxxx
Real-life Analogy:
In a social media platform, if you have comments attached to a user,
and the user decides to delete their account, the comments made by
that user could be set to have a NULL user.
class User(models.Model):
username = models.CharField(max_length=100)
class Comment(models.Model):
text = models.TextField()
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)