I got it, I have to use Inline Fields!
Django Admin Forms with additional fields in ManyToMany relations
-
15-07-2023 - |
Question
I have 2 Entities with a ManyToMany Relation and some additional fields, here you can find an example diagram:
I created all models following the documentation and everything works, but I would also manage MTM relations using django admin without use another form to create a new "WheelsCar" row that links togheter a car and a wheel. Is it possible? How?
Admin use case:
- I click on add new Car
- I select one of the wheels, filling the additional fields (position, holes...)
- Iterate step 2
- Save a New Car
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow