#9025: Nested Inline Support in Admin
-------------------------------+------------------------------------
     Reporter:  pixelcort      |                    Owner:  Gargamel
         Type:  New feature    |                   Status:  assigned
    Component:  contrib.admin  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  1              |  Patch needs improvement:  1
Easy pickings:  0              |                    UI/UX:  1
-------------------------------+------------------------------------

Comment (by bjola):

 Another bug: in contrib/admin/static/js/inlines.js, the lines:
 {{{
 // Update Form Properties
 template.find('#id_' + formset_prefix + '-TOTAL_FORMS').val(1);
 update_props(template, normalized_formset_prefix, formset_prefix);
 }}}

 should be
 {{{
 // Update Form Properties
 update_props(template, normalized_formset_prefix, formset_prefix);
 template.find('#id_' + formset_prefix + '-TOTAL_FORMS').val(1);
 template.find('#id_' + formset_prefix + '-INITIAL_FORMS').val(0);
 }}}

 Because the TOTAL_FORMS and INITIAL_FORMS inputs do not have the right IDs
 until update_props is run. And INITIAL_FORMS needs to be 0, otherwise the
 server-side validation tries to save non-existing nested forms.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/9025#comment:137>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to