I often need an admin interface to closely related models. For example, in a Quiz application, I might have a model that represents a Question, which has many related Answer models. In the admin UI, I'd like use a single form to create a Question object with many possible Answer objects connected to it. I probably don't want any direct interface to the Answer resource on its own, in fact. I want a Question resource, and when I edit the Question model, I can easily add/remove/edit the associated Answers.
Django admin calls these "inline" models.
The current alternative is very clunky. If I expose an Answer resource, then to make a full quiz question, I would first create a Question object, and then go to the Answer resource and, one by one, create Answers, and in each one I would have to associate the answer with the right Question.
I imagine I might be able to do something with custom components, but there's not enough structure there to make it obvious how to proceed.
I think this is quite common. Think about an admin for a User with many Addresses, or Credit Cards. A library with Authors and many Books. A Meal Delivery service for restaurants that has Menus, each with many Items on it.
I often need an admin interface to closely related models. For example, in a Quiz application, I might have a model that represents a Question, which has many related Answer models. In the admin UI, I'd like use a single form to create a Question object with many possible Answer objects connected to it. I probably don't want any direct interface to the Answer resource on its own, in fact. I want a Question resource, and when I edit the Question model, I can easily add/remove/edit the associated Answers.
Django admin calls these "inline" models.
The current alternative is very clunky. If I expose an Answer resource, then to make a full quiz question, I would first create a Question object, and then go to the Answer resource and, one by one, create Answers, and in each one I would have to associate the answer with the right Question.
I imagine I might be able to do something with custom components, but there's not enough structure there to make it obvious how to proceed.
I think this is quite common. Think about an admin for a User with many Addresses, or Credit Cards. A library with Authors and many Books. A Meal Delivery service for restaurants that has Menus, each with many Items on it.