So I have set up the following codes for sample from followed by inline formset of its foreign key, sample detail. I also added some dynamic feature to it so that you could add more rows for the formset via Jquery. I got the Jquery section from http://stackoverflow.com/questions/501719/dynamically-adding-a-form-to-a-django-formset-with-ajax. I tried both implementation but it appears to have the same result. I am wondering if I did something wrong in the view. views.py
forms.py
However, I have this problem that only the first formset instance is ever saved. no matter how many I put in dynamically. Could someone please help me? POST data when using Jquery to add one more instance (2 instances in total) POST data when not using Jquery, setting extra = 2. (2 instances in total) |
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05b3973b-158b-4656-a1cb-97c74f1cec81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment