diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index 5cb8f1f..5eff2fc 100644
a
|
b
|
class InlineAdminForm(AdminForm):
|
137 | 137 | self.formset = formset |
138 | 138 | self.original = original |
139 | 139 | if original is not None: |
140 | | self.original.content_type_id = ContentType.objects.get_for_model(original).pk |
| 140 | self.original.admin_helpers_content_type_id = ContentType.objects.get_for_model(original).pk |
141 | 141 | self.show_url = original and hasattr(original, 'get_absolute_url') |
142 | 142 | super(InlineAdminForm, self).__init__(form, fieldsets, prepopulated_fields) |
143 | 143 | |
diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html
index 8548855..e95a6a0 100644
a
|
b
|
|
10 | 10 | {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %} |
11 | 11 | </h3> |
12 | 12 | {% if inline_admin_form.show_url %} |
13 | | <p><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p> |
| 13 | <p><a href="../../../r/{{ inline_admin_form.original.admin_helpers_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p> |
14 | 14 | {% endif %} |
15 | 15 | {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %} |
16 | 16 | |
diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html
index 820928a..0694e31 100644
a
|
b
|
|
14 | 14 | {% endfor %} |
15 | 15 | {% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %} |
16 | 16 | </tr></thead> |
17 | | |
| 17 | |
18 | 18 | {% for inline_admin_form in inline_admin_formset %} |
19 | 19 | {% if inline_admin_form.form.non_field_errors %} |
20 | 20 | <tr><td colspan="{{ inline_admin_form.field_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr> |
… |
… |
|
24 | 24 | <td class="original"> |
25 | 25 | {% if inline_admin_form.original or inline_admin_form.show_url %}<p> |
26 | 26 | {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %} |
27 | | {% 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 %} |
| 27 | {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.admin_helpers_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %} |
28 | 28 | </p>{% endif %} |
29 | 29 | {{ inline_admin_form.pk_field.field }} {{ inline_admin_form.fk_field.field }} |
30 | 30 | {% spaceless %} |
… |
… |
|
48 | 48 | {% endfor %} |
49 | 49 | {% endfor %} |
50 | 50 | {% endfor %} |
51 | | |
| 51 | |
52 | 52 | {% if inline_admin_formset.formset.can_delete %} |
53 | 53 | <td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td> |
54 | 54 | {% endif %} |
55 | | |
| 55 | |
56 | 56 | </tr> |
57 | 57 | |
58 | 58 | {% endfor %} |
59 | | |
| 59 | |
60 | 60 | </table> |
61 | | |
| 61 | |
62 | 62 | </fieldset> |
63 | 63 | </div> |
64 | | |
| 64 | |
65 | 65 | {# <ul class="tools"> #} |
66 | 66 | {# <li><a class="add" href="">Add another {{ inline_admin_formset.opts.verbose_name|title }}</a></li> #} |
67 | 67 | {# </ul> #} |
68 | | |
| 68 | |
69 | 69 | </div> |