Creating multiple instances of inlineformset_factory dinamically

28 views
Skip to first unread message

dmemb...@robottions.com

unread,
Apr 24, 2018, 7:34:35 AM4/24/18
to Django developers (Contributions to Django itself)
I've two Models in a form (Entry, the Parent, and Box, the Child one as an inlineformset_factory. Every Entry should have X Boxes). 

On the EntryCreateView template I've access to both models, but I want to add a non-model field that let's me specify how many instances of Boxes I want, and a select to select the material. So, if you type '10' as number of boxes and Steel as material, it should create 10 Box instances with the Steel Material pre-selected.

It is possible to do this in Django? What functionality should I use to do this?
Reply all
Reply to author
Forward
0 new messages