I have this model in Django, where a person
has the same information from the user
provided by Django plus a little bit more information. When I create a new person
it requires to create a new user
also, that's fine. But when I delete a person
the user
still remains on my database. What am I missing here ? I would like to delete the user
too.
class Person(models.Model):
user = OneToOneField(User)
gender = CharField(max_length=1, choices=GenderChoices, blank=True, null=True)
birth_date = DateField(blank=True, null=True)
def __unicode__(self):
return self.user.username