0

I have two models that are linked by a foreign key relationship:

class A(models.Model):
    q1 = models.CharField(max_length=60)
    q2 = models.CharField(max_length=60)
    ... 

class B(models.Model):
    b = models.CharField(max_length=60)
    a = models.ForeignKey("A", on_delete=models.CASCADE)

In my admin site I have the A model showing, and ideally would like to keep it that way.

Is there a way for me to within the individual A instances show the B instances? I have only been able to find solutions for the reverse (showing a dropdown of A instances in the individual B instances).

goalie1998
  • 1,427
  • 1
  • 9
  • 16
  • 1
    https://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects – iklinac Feb 10 '21 at 21:39
  • @iklinac Thank you. I misread/didn't fully understand that article initially, but your suggestion made me revisit it. If you put it as an answer, I can upvote and accept it. – goalie1998 Feb 10 '21 at 21:43

0 Answers0