Clone formset

10 views
Skip to first unread message

Adam Teale

unread,
Jan 18, 2017, 7:36:24 AM1/18/17
to Django users
Hi everyone,

Is it possible to clone a formset (inlineformset_factory)?

I'm not sure what would be the correct way to do so.

I am able to clone the form by:

form = self.get_form(form_class)
form.instance.save()

When it comes to the formset I don't know the method.
I think I understand that it is the formset's management_form that I need to manipulate to set the foeignkey to the cloned form.pk

Any suggestions?

I hope my question makes some sense.

Thanks

Adam
Reply all
Reply to author
Forward
0 new messages