I'm working on a model class that will represent the relationship of one family member to another (part of a geneology feature)
My Class is:
class FamilyLink(models.Model):
from_legacy = models.ForeignKey(Legacy)
to_legacy = models.ForeignKey(Legacy)
class Meta:
unique_together = ("from_legacy", "to_legacy")
When I try and migrate I get the following error message:
CommandError: One or more models did not validate: archive.familylink: Accessor for field 'from_legacy' clashes with related field 'Legacy.familylink_set'. Add a related_name argument to the definition for 'from_legacy'. archive.familylink: Accessor for field 'to_legacy' clashes with related field 'Legacy.familylink_set'. Add a related_name argument to the definition for 'to_legacy'.
It seem my issue is having two foreignKey's in the same class both pointing to the same class (in this case the "Legacy" class). Does anyone know how I can be resolve/work around this?
I appreciate the thoughts and expertise.