I'm working on a page with nested formsets, it works fine with static inline formsets, but when I try to create forms dynamically I get a problem. The prefix generated for a nested formset is its parent's one + its own, like: student-0-address-0.
But for empty_form both are just '__prefix__, like': student-__prefix__-address-__prefix__. Eventually when the user adds a new form my javascript will change every '__prefix__' in the new cloned empty_form element to the amount of class="student-form" there is, so it ends up like this: # first nested formset generated: <label for="id_student-0-address-0-street">Street:</label> <input id="id_student-0-address-0-street " ...> # second nested formset generated: <label for="id_student-1-address-1-street">Street:</label> <input id="id_student-1-address-1-street " ...> The second -1- here should be zero, but my regex changes every '__prefix__'. I suppose I could change the regex to only target each individually, but then I'd have two problems, so how can i change the default empty_form prefix? -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/97fa5ebb-5cb6-4eb3-b583-c23d38518db9n%40googlegroups.com.