I have n classes and each class contains a column called key like this (where n==3)
class class1(models.Model):
Id1 = models.AutoField(primary_key=True)
key = models.CharField(max_length = 16, blank=True)
class class2(models.Model):
Id2 = models.AutoField(primary_key=True)
key = models.CharField(max_length = 16, blank=True)
class class3(models.Model):
Id3 = models.AutoField(primary_key=True)
key = models.CharField(max_length = 16, blank=True)
I want to make the column key as Foreign key between all the n classes? I know how make a foreign key between 2 classes but I want to do that with many classes because I have about 40 classes and some classes has some commun columns