Creating multiple instances of inlineformset_factory dinamically

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Creating multiple instances of inlineformset_factory dinamically

dmembrives
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?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6ff0bfab-951d-4385-9722-eef1d30e219b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.