0

I saw a what might be a solution to my problem here but i tried to understand and implement the code on what is indicated in the solution with no avail.

As what I understand( if correct ), in the views, the use of cp = request.POST.copy() is to copy what is in the form and then the use of cp['prim-TOTAL_FORMS'] = int(cp['prim-TOTAL_FORMS'])+ 1 is to add the field but from there I am lost

Sorry for my newbie question because I am very new to django.

Any pointers, suggestion, or even a sample code would helpful and much appreciated.

Thank you in advance.

1 Answer 1

0

I am currently working to figure this out myself. The best I could come up with is an a input type="number" and a separate input type="submit" with an "add rows" action. We can check the add rows with request.POST.get('action') to see if we are submitting for review or adding additional forms. This is as far as I am currently. I can read the number input, but when I pass it to the formset_factory via the extra attribute. Have you solved this?

Sign up to request clarification or add additional context in comments.

1 Comment

I know this is old and really, I haven't solved this one yet but there is a library that might help here, I used it and works great so far

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.