A
A
Andrew2021-10-28 13:05:31
Django
Andrew, 2021-10-28 13:05:31

How to make detail view in Django admin?

Friends, I ran into a problem with the convenience of working with the models.ManyToManyField field.

If it is set without through, I get a multiple choice field, which is convenient on the one hand, but when it is large, there is a risk of accidentally poke in the wrong place when editing and all previous selections will be lost.

Another option is through: models.ManyToManyField(Work, through="MaterialGroupWork"

) already created connections are not visible. I would like to make it possible to go to a detail view page. Where there will be all the necessary information about the object, see if there is a necessary many-to-many relationship, and if not, click add and go to the form for adding a new relationship.
How to implement something similar in the native admin panel?

And even without this task, I really want to see some models in the detail View, which will join other models and show data from the joins too.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question