Answer the question
In order to leave comments, you need to log in
How to bind dropdown fields in Django (FOREIGN KEY)?
I have a model with two foreign keys.
I use this model inside a display that inherits from nested_admin.NestedTabularInline
How can I make it so that I can select the first value in the drop-down list in the admin panel, and then pull up the values corresponding to the first from the database?
class Test(models.Model):
field_a = models.ForeignKey("tmp.A",
on_delete=models.CASCADE)
field_b = models.ForeignKey("tmp.B",
on_delete=models.CASCADE)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question