Index: django/contrib/admin/helpers.py
===================================================================
--- django/contrib/admin/helpers.py	(revision 9232)
+++ django/contrib/admin/helpers.py	(working copy)
@@ -126,7 +126,7 @@
         self.formset = formset
         self.original = original
         if original is not None:
-            self.original.content_type_id = ContentType.objects.get_for_model(original).pk
+            self.original.my_own_content_type_id = ContentType.objects.get_for_model(original).pk
         self.show_url = original and hasattr(original, 'get_absolute_url')
         super(InlineAdminForm, self).__init__(form, fieldsets, prepopulated_fields)
 
Index: django/contrib/admin/templates/admin/edit_inline/stacked.html
===================================================================
--- django/contrib/admin/templates/admin/edit_inline/stacked.html	(revision 9232)
+++ django/contrib/admin/templates/admin/edit_inline/stacked.html	(working copy)
@@ -10,7 +10,7 @@
     {% 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 %}
   </h3>
   {% if inline_admin_form.show_url %}
-  <p><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p>
+  <p><a href="../../../r/{{ inline_admin_form.original.my_own_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p>
   {% endif %}
 
   {% for fieldset in inline_admin_form %}
Index: django/contrib/admin/templates/admin/edit_inline/tabular.html
===================================================================
--- django/contrib/admin/templates/admin/edit_inline/tabular.html	(revision 9232)
+++ django/contrib/admin/templates/admin/edit_inline/tabular.html	(working copy)
@@ -22,7 +22,7 @@
         <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 %}
+          {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.my_own_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
             </p>{% endif %}
           {{ inline_admin_form.pk_field.field }}
           {% spaceless %}
Index: tests/regressiontests/admin_inlines/__init__.py
===================================================================
--- tests/regressiontests/admin_inlines/__init__.py	(revision 0)
+++ tests/regressiontests/admin_inlines/__init__.py	(revision 0)
@@ -0,0 +1 @@
+#
Index: tests/regressiontests/admin_inlines/models.py
===================================================================
--- tests/regressiontests/admin_inlines/models.py	(revision 0)
+++ tests/regressiontests/admin_inlines/models.py	(revision 0)
@@ -0,0 +1,49 @@
+"""
+Testing of admin inline formsets.
+
+"""
+from django.db import models
+from django.contrib.contenttypes.models import ContentType
+from django.contrib.contenttypes import generic
+
+class Parent(models.Model):
+    name = models.CharField(max_length=50)
+
+    def __unicode__(self):
+        return self.name
+
+class Teacher(models.Model):
+    name = models.CharField(max_length=50)
+
+    def __unicode__(self):
+        return self.name
+
+class Child(models.Model):
+    name = models.CharField(max_length=50)
+    teacher = models.ForeignKey(Teacher)
+
+    content_type = models.ForeignKey(ContentType)
+    object_id = models.PositiveIntegerField()
+    parent = generic.GenericForeignKey()
+
+    def __unicode__(self):
+        return u'I am %s, a child of %s' % (self.name, self.parent)
+    
+__test__ = {'API_TESTS': """
+
+# Regression test for #9362
+
+>>> sally = Teacher.objects.create(name='Sally')
+>>> john = Parent.objects.create(name='John')
+>>> joe = Child.objects.create(name='Joe', teacher=sally, parent=john)
+
+The problem depends only on InlineAdminForm and its "original" argument, so
+we can safely set the other arguments to None/{}.
+
+>>> from django.contrib.admin.helpers import InlineAdminForm
+>>> iaf = InlineAdminForm(None, None, None, {}, joe)
+>>> iaf.original
+<Child: I am Joe, a child of John>
+
+"""
+}
