Django displays data from ReferManager to Model Admin

This example is below in the admin, if the access page (add or edit) I can select case from Foo. However, I want to be able to display two field names and a list of Bar elements registered from that Foo when accessing the Foo page (adding or editing).

I tried to use the manager associated with it, but I don't understand very well how it works.

class Foo(models.Model):
    title = models.CharField(max_length=100

class Bar(models.Model):
    name = models.CharField(max_length=100)
    value = models.CharField(max_length=100)
    foo = models.ForeignKey(Foo)

      

enter image description here

+3


source to share





All Articles