﻿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
13696	Admin Edit Inline templates don' t output hidden field for PK when it isn't an autoField and has editable=False	evan.reiser@…	Alexander Herrmann	"In my project I'm using a UUID field where I generate the uuid myself in python, and don't rely on any sequences on the database side.  Because of this I just use a CharField field, and when used i set it to be the primary key.  However because of this usage the field does not have 'has_auto_field' == True, This causes the edit inline forms for existing objects to not output the hidden field to hold the PK for the existing object.


Right now this template requires the inline_admin_form.has_auto_field == True, for it to output the pk_field.field, however I think this should always output the primary key for the object.

This line occurs on line 30 of contrib/admin/templates/admin/edit_inline/tabular.html in django 1.2.1

{% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}




contrib/admin/templates/admin/edit_inline/tabular.html
{{{
        <td class=""original"">
          {% if inline_admin_form.original or inline_admin_form.show_url %}<p>
          {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %}
          {% if inline_admin_form.show_url %}<a href=""../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/"">{% trans ""View on site"" %}</a>{% endif %}
            </p>{% endif %}
          {% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
          {{ inline_admin_form.fk_field.field }}
          {% spaceless %}
          {% for fieldset in inline_admin_form %}
            {% for line in fieldset %}
              {% for field in line %}
                {% if field.is_hidden %} {{ field.field }} {% endif %}
              {% endfor %}
            {% endfor %}
          {% endfor %}
          {% endspaceless %}
        </td>
}}}
"	Bug	closed	contrib.admin	1.2	Normal	fixed	inline templates	evan.reiser@… issac.kelly@…	Accepted	1	0	0	0	1	0
