Django Model inheritance error "field ... clashes with the field"
I'm having a problem when using multi-table inheritance in Django and I didn't find something that solved it.
I have these two models:
class Person(models.Model):
id = models.CharField(primary_key=True, max_length=12, default="")
name = models.CharField(max_length=12, default="")
birthday = models.DateField()
class Parent(Person):
work = models.CharField(max_length=70, default="")
spouce_field = models.OneToOneField(Person, on_delete=DO_NOTHING, related_name="spouce_field")
And I get this error when running python3 manage.py makemigrations
:
ERRORS:
family.Parent.spouce_field: (models.E006) The field 'spouce_field' clashes with the field 'spouce_field' from model 'person.person'.
Any idea what am I doing wrong?