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. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5febac08-6b1f-4c8a-a067-6abaf3f162a3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.