I don't have much experience with Django, but you may want to consider removing the RelatedToProject
field and adding another class called PartnersRelatedToProjects
(or something like that). Then simply set up a normal foreign key from this new class to the Partner
table, and in the Project
class set up a normal foreign key to this new table.
You would then need to keep track of which partners are related to projects by adding them to the new PartnersRelatedToProjects
table.
class Partner(models.Model):
Name = models.CharField(max_length=200)
Description = models.CharField(max_length=200)
class PartnersRelatedToProjects(models.Model):
partner = models.ForeignKey('Partner')
class Project(models.Model):
name = models.CharField(max_length=200)
partner = models.ForeignKey('PartnersRelatedToProjects')