﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13175	"""+ Add another [...]"" bug with final_attrs['id']"	rasca	Simon Meers	"When adding a new inline in the admin through ""+ Add another [...]"" the id of the inputs is different from what final_attrs.id says it should be.

For example when rendering a widget that prints final_attrs.id I get
{{{
id_sponsor_set-4-logo
}}}
but actually the id is
{{{
id_sponsor_set-3-logo
}}}

To make this clear (can't express myself clearly) you can try changing line 218 from django/forms/widgets.py to 

{{{
212	    def render(self, name, value, attrs=None):
213	        if value is None: value = ''
214	        final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
215	        if value != '':
216	            # Only add the 'value' attribute if a value is non-empty.
217	            final_attrs['value'] = force_unicode(formats.localize_input(value))
218	        return mark_safe(u'<input%s />' % flatatt(final_attrs))

218	        return mark_safe(u'expected id: %s <input%s />' % (final_attrs['id'], flatatt(final_attrs)))
}}}
and add a new inline through the link and check what's been printed with the id of an input inside the newly created inline

This small changes breaks many 3rd party apps."		closed	contrib.admin	dev		fixed	inline javascript	rasca7@…	Accepted	1	0	0	0	0	0
