Ok, thanks for replying. am quite new in Django. Am looking for a way to use a primary key in 3 models in my django project. for instance. The models are Profile, Subject and Grade. Want subject to link to profile and grade to link to subject.
class Profile(models.Model):
f_name = models.CharField(max_length=20)
l_name = models.CharField(max_length=20)
sch_id = models.CharField(max_length=20)
class Subject(models.Model):
profile = models.ForeignKey(Profile, on_delete=models.CASCADE)
maths = models.CharField(max_length=20)
english = models.CharField(max_length=20)
class Grade(models.Model):
subjt = models.ForeignKey(Subject, on_delete=models.CASCADE)
score = models.CharField(max_length=20)
grad = models.CharField(max_length=20)
I don't know to archive this.