I would like to implement a model with self-dependency. Say instance People_A may depend on People_B and People_C. I first implement this model with many to many key.
class People(models.Model):
dependency = models. ManyToManyField ('self', blank=True, null=True)
But the result is that if People_A depend on People_B will result in People_B depend also on People_A. That’s something I don’t want to have.
Then I implement it with foreign key.
class People(models.Model):
dependency = models.ForeignKey('self', blank=True, null=True)
But this doesn’t work also. If People_A depend on People_B, then no other People could depend on People_B. It will cover the old dependency with the latest dependency.
Any clue would be thankful
I think this is what you're looking for:
See the docs for symmetrical.