Management form in Model Formsets

58 views
Skip to first unread message

Knight Samar

unread,
Jul 1, 2012, 12:27:01 AM7/1/12
to django...@googlegroups.com
Hi,

I am using Django 1.2 and developing using Model formsets. Using JavaScript, I am allowing the user to dynamically "Add another" formset on the template, but I can't figure out what exactly I have to modify in the management forms, for all the formsets to be successfully saved.

The documentation points out to three properties in the management form - form-TOTAL_FORMS, form-INITIAL_FORMS and form-MAX_NUM_FORMS. But I don't understand, which properties I have to exactly modify and how, when a new formset is being added dynamically using JavaScript ?

Thanks :)

Regards,
Samar

Thomas Orozco

unread,
Jul 1, 2012, 12:42:37 PM7/1/12
to django...@googlegroups.com

You might want to check this snippet out: djangosnippets.org/snippets/1389/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Ecs6EVDku_YJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Knight Samar

unread,
Jul 1, 2012, 1:31:42 PM7/1/12
to django...@googlegroups.com

Thanks Thomas! I checked the script and tried to follow it.

It seems that for Django 1.2, not modifying the form-TOTAL_FORMS, form-INITIAL_FORMS and form-MAX_NUM_FORMS works properly!!

Regards,
Samar
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages