Answer the question
In order to leave comments, you need to log in
How to add lookup to admin panel?
I have a customized admin panel where I can edit Django objects (perform CRUD operations). I edit one of the fields in the admin panel (for example, the field is called " field1 " in the " table1 " model) manually, enter the desired value, click save - everything is ok, the object changes, the record in the database is saved (on the first screenshot)
But this is not very convenient . Is there any way to make the entry in field1 selectable from a drop down list? Which, in turn, would be formed from the records of the field2 column of another table table2 ?
Approximately I tried to depict what I want to get in the second screenshot)
That is, tables table1 andtable2 are linked by some foreign key, and this same foreign key must be pulled from another table to the drop-down list
. I did not find how this can be implemented using standard admin methods. Is there any way to quickly add such functionality in the admin panel?
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