Index: django/forms/models.py
===================================================================
--- django/forms/models.py	(revision 10744)
+++ django/forms/models.py	(working copy)
@@ -612,7 +612,12 @@
         for form in self.initial_forms:
             pk_name = self._pk_field.name
             raw_pk_value = form._raw_value(pk_name)
-            pk_value = form.fields[pk_name].clean(raw_pk_value).pk
+
+            if hasattr(form.fields[pk_name].clean(raw_pk_value), 'pk'): 
+                pk_value = form.fields[pk_name].clean(raw_pk_value).pk
+            else:
+                pk_value = form.fields[pk_name].clean(raw_pk_value)
+                
             obj = existing_objects[pk_value]
             if self.can_delete:
                 raw_delete_value = form._raw_value(DELETION_FIELD_NAME)
Index: tests/regressiontests/admin_views/tests.py
===================================================================
--- tests/regressiontests/admin_views/tests.py	(revision 10744)
+++ tests/regressiontests/admin_views/tests.py	(working copy)
@@ -1326,70 +1326,70 @@
         self.failUnlessEqual(Grommet.objects.count(), 1)
         self.failUnlessEqual(Grommet.objects.all()[0].name, "Grommet 1 Updated")
 
-    # def test_char_pk_inline(self):
-    #     "A model with a character PK can be saved as inlines. Regression for #10992"
-    #     # First add a new inline
-    #     self.post_data['doohickey_set-0-code'] = "DH1"
-    #     self.post_data['doohickey_set-0-name'] = "Doohickey 1"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(DooHickey.objects.count(), 1)
-    #     self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1")
-    #
-    #     # Check that the PK link exists on the rendered form
-    #     response = self.client.get('/test_admin/admin/admin_views/collector/1/')
-    #     self.assertContains(response, 'name="doohickey_set-0-code"')
-    #
-    #     # Now resave that inline
-    #     self.post_data['doohickey_set-INITIAL_FORMS'] = "1"
-    #     self.post_data['doohickey_set-0-code'] = "DH1"
-    #     self.post_data['doohickey_set-0-name'] = "Doohickey 1"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(DooHickey.objects.count(), 1)
-    #     self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1")
-    #
-    #     # Now modify that inline
-    #     self.post_data['doohickey_set-INITIAL_FORMS'] = "1"
-    #     self.post_data['doohickey_set-0-code'] = "DH1"
-    #     self.post_data['doohickey_set-0-name'] = "Doohickey 1 Updated"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(DooHickey.objects.count(), 1)
-    #     self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1 Updated")
+    def test_char_pk_inline(self):
+        "A model with a character PK can be saved as inlines. Regression for #10992"
+        # First add a new inline
+        self.post_data['doohickey_set-0-code'] = "DH1"
+        self.post_data['doohickey_set-0-name'] = "Doohickey 1"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(DooHickey.objects.count(), 1)
+        self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1")
+    
+        # Check that the PK link exists on the rendered form
+        response = self.client.get('/test_admin/admin/admin_views/collector/1/')
+        self.assertContains(response, 'name="doohickey_set-0-code"')
+    
+        # Now resave that inline
+        self.post_data['doohickey_set-INITIAL_FORMS'] = "1"
+        self.post_data['doohickey_set-0-code'] = "DH1"
+        self.post_data['doohickey_set-0-name'] = "Doohickey 1"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(DooHickey.objects.count(), 1)
+        self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1")
+    
+        # Now modify that inline
+        self.post_data['doohickey_set-INITIAL_FORMS'] = "1"
+        self.post_data['doohickey_set-0-code'] = "DH1"
+        self.post_data['doohickey_set-0-name'] = "Doohickey 1 Updated"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(DooHickey.objects.count(), 1)
+        self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1 Updated")
+    
+    def test_integer_pk_inline(self):
+        "A model with an integer PK can be saved as inlines. Regression for #10992"
+        # First add a new inline
+        self.post_data['whatsit_set-0-index'] = "42"
+        self.post_data['whatsit_set-0-name'] = "Whatsit 1"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(Whatsit.objects.count(), 1)
+        self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1")
+    
+        # Check that the PK link exists on the rendered form
+        response = self.client.get('/test_admin/admin/admin_views/collector/1/')
+        self.assertContains(response, 'name="whatsit_set-0-index"')
+    
+        # Now resave that inline
+        self.post_data['whatsit_set-INITIAL_FORMS'] = "1"
+        self.post_data['whatsit_set-0-index'] = "42"
+        self.post_data['whatsit_set-0-name'] = "Whatsit 1"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(Whatsit.objects.count(), 1)
+        self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1")
+    
+        # Now modify that inline
+        self.post_data['whatsit_set-INITIAL_FORMS'] = "1"
+        self.post_data['whatsit_set-0-index'] = "42"
+        self.post_data['whatsit_set-0-name'] = "Whatsit 1 Updated"
+        response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
+        self.failUnlessEqual(response.status_code, 302)
+        self.failUnlessEqual(Whatsit.objects.count(), 1)
+        self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1 Updated")
 
-    # def test_integer_pk_inline(self):
-    #     "A model with an integer PK can be saved as inlines. Regression for #10992"
-    #     # First add a new inline
-    #     self.post_data['whatsit_set-0-index'] = "42"
-    #     self.post_data['whatsit_set-0-name'] = "Whatsit 1"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(Whatsit.objects.count(), 1)
-    #     self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1")
-    #
-    #     # Check that the PK link exists on the rendered form
-    #     response = self.client.get('/test_admin/admin/admin_views/collector/1/')
-    #     self.assertContains(response, 'name="whatsit_set-0-index"')
-    #
-    #     # Now resave that inline
-    #     self.post_data['whatsit_set-INITIAL_FORMS'] = "1"
-    #     self.post_data['whatsit_set-0-index'] = "42"
-    #     self.post_data['whatsit_set-0-name'] = "Whatsit 1"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(Whatsit.objects.count(), 1)
-    #     self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1")
-    #
-    #     # Now modify that inline
-    #     self.post_data['whatsit_set-INITIAL_FORMS'] = "1"
-    #     self.post_data['whatsit_set-0-index'] = "42"
-    #     self.post_data['whatsit_set-0-name'] = "Whatsit 1 Updated"
-    #     response = self.client.post('/test_admin/admin/admin_views/collector/1/', self.post_data)
-    #     self.failUnlessEqual(response.status_code, 302)
-    #     self.failUnlessEqual(Whatsit.objects.count(), 1)
-    #     self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1 Updated")
-
     def test_inherited_inline(self):
         "An inherited model can be saved as inlines. Regression for #11042"
         # First add a new inline
