You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using inline formsets (extra=1, can_delete=True) and hideLastAddForm=true the deletion of an instance (after submitting) fails. However, with hideLastAddForm=false deletion works.
I noticed that the only difference in the POST requests was the "TOTAL_FORMS" field which was n-1 when hideLastAddForm=true. That has prevented the deletion of the object in django.
By commenting out line "totalForms.val(forms.length);" in line 95 (1.5-pre) i could fix that for me.
However, iam not an javascript expert so not sure if this is the right solution?
Best,
Cornelius
The text was updated successfully, but these errors were encountered:
For what I traced in the Django code is, that the TOTAL_FORMS count has to include both visible and hidden form groups in the formset, as all form data is POSTed (deleted ones are marked with DELETE: "on" attribute). Decreasing the counter would not make the formset creating any (initial) forms for data having an index bigger than the decreased TOTAL_FORMS .
When using inline formsets (extra=1, can_delete=True) and hideLastAddForm=true the deletion of an instance (after submitting) fails. However, with hideLastAddForm=false deletion works.
I noticed that the only difference in the POST requests was the "TOTAL_FORMS" field which was n-1 when hideLastAddForm=true. That has prevented the deletion of the object in django.
By commenting out line "totalForms.val(forms.length);" in line 95 (1.5-pre) i could fix that for me.
However, iam not an javascript expert so not sure if this is the right solution?
Best,
Cornelius
The text was updated successfully, but these errors were encountered: