diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index 9312eab..1b47027 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.inline_model_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..179d902 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.inline_model_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..3f88f73 100644
a
|
b
|
|
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.inline_model_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 %} |