Closed lmores closed 7 years ago
Can you provide the template of the forms you're using? I feel like you forgot one part. See http://stackoverflow.com/questions/18022792/django-managementform-data-is-missing-or-has-been-tampered-with-when-saving-mo Tell us if it's relevant. Right now, formset is not yet supported correctly but If you feel you can find a stable solution, we'd like to hear from you so that we can integrate this to the library. Cheers
My bad, the error was due to a wrong kwarg
I was passing to MyFormSet
in the view (and, yes, I printed the management_form
fields in my template).
Anyhow the NgModelFormSet
hack I pasted in my first comment seems to be definitely mandatory.
I'll leave the issue open and keep doing some more experiments before reporting my results and then I'll close it. Is it ok?
Yes sure. If you get a working example with formsets, would you have the time and the kindness to submit a pull request with your changes? It would a good plus to this library. It's been a while people ask for formset support... We did not manage to find the time to do it yet ! Cheers
In the end I changed my mind and I decided to render my forms completely client side using pure angular. Therefore I didn't further investigate possible implementations for this package. Anyway all the above remains unchanged, imho.
Sirion
P.S.: should I close this issue?
let it openned. At some point, we should reach a point where we have a complete working example with formsets... :pray:
I've been using django formsets and unfortunately they don't play well with django-angular.
First of all I've had to deal with default naming of forms:
form-0
,from-1
, ... which are illegal variable names in javascript (which led to runtime error "unexpected token" in angularjs). I solved this issue by overwriting djangoBaseModelFormSet
:and passing it to the factory:
and that seems to solve the issue.
But now I'm facing problems with
{{ formset.management_form}}
which raises the errorManagementForm data is missing or has been tampered with
on template rendering. That's because it's instance propertyself.errors
contains this garbage:and I'm not familiar enough with django-angular to solve it. Is anyone planning to integrate formsets in this still very useful project?
P.S.: I'm new to django-angular and GitHub.