SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.27k stars 669 forks source link

Support editing of inline models #373

Open jannotti opened 4 years ago

jannotti commented 4 years ago

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.

wojtek-krysiak commented 4 years ago

this is awesome !!! - definitely will do that (not sure where though) - but definitely

dustinlacewell commented 3 years ago

This would be a substantial raise in value of AdminBro.

EdByrnee commented 2 years ago

This would be great