michalpokusa / django-admin-action-forms

Extension for the Django admin panel that allows passing additional parameters to actions by creating intermediate pages with forms.
https://pypi.org/project/django-admin-action-forms/
MIT License
95 stars 3 forks source link

Feature Request: Support for inlines #3

Open sandro-qiang opened 2 weeks ago

michalpokusa commented 2 weeks ago

Could you elaborate on the idea?

sandro-qiang commented 2 weeks ago

I need to implement something like stackinline in modeladmin, the main form for some options, and a related formset for none or one or more additional options group.

michalpokusa commented 2 weeks ago

I think I understand what you mean.

Inlines are not part of the standard Django forms api, in ModelAdmin they represent instances of other models, but in this case, they would probably be passed as a list of dicts, where each dict represent one record in inline.

I will have to check, how cumbersome it would be to implement them, but this is definitely not a quick thing to do.

To be honest, I am not 100% sure that this should be implemented, if it turns out it requires a lot of hacks or partial/complete rewrite of Django original logic, I might pass on that.

Nevertheless, I will check what can be done here.

PS. Another approach to you problem might be to create models that represent your options structure, and create objects of them, on which you can later can run actions, even without this library. Of course, it is not as straightforward, but might be worth looking into. 🙂