Index: docs/ref/contrib/admin/index.txt
===================================================================
--- docs/ref/contrib/admin/index.txt	(revision 15481)
+++ docs/ref/contrib/admin/index.txt	(working copy)
@@ -831,6 +831,15 @@
     a ``list`` or ``tuple`` of field names that will be displayed as read-only,
     as described above in the :attr:`ModelAdmin.readonly_fields` section.
 
+.. method:: ModelAdmin.get_prepopulated_fields(self, request, obj=None)
+
+    .. versionadded:: 1.3
+
+    The ``get_prepopulated_fields`` method is given the ``HttpRequest`` and the
+    ``obj`` being edited (or ``None`` on an add form) and is expected to return
+    a ``dictionary``, as described above in the :attr:`ModelAdmin.prepopulated_fields`
+    section.
+
 .. method:: ModelAdmin.get_urls(self)
 
     The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for
Index: django/contrib/admin/options.py
===================================================================
--- django/contrib/admin/options.py	(revision 15481)
+++ django/contrib/admin/options.py	(working copy)
@@ -193,6 +193,12 @@
     def get_readonly_fields(self, request, obj=None):
         return self.readonly_fields
 
+    def get_prepopulated_fields(self, request, obj=None):
+        """
+        Hook for specifying customizing prepopulated fields.
+        """
+        return self.prepopulated_fields
+
     def queryset(self, request):
         """
         Returns a QuerySet of all model instances that can be edited by the
@@ -898,7 +904,8 @@
                 formsets.append(formset)
 
         adminForm = helpers.AdminForm(form, list(self.get_fieldsets(request)),
-            self.prepopulated_fields, self.get_readonly_fields(request),
+            self.get_prepopulated_fields(request),
+            self.get_readonly_fields(request),
             model_admin=self)
         media = self.media + adminForm.media
 
@@ -906,8 +913,9 @@
         for inline, formset in zip(self.inline_instances, formsets):
             fieldsets = list(inline.get_fieldsets(request))
             readonly = list(inline.get_readonly_fields(request))
+            prepopulated = dict(inline.get_prepopulated_fields(request))
             inline_admin_formset = helpers.InlineAdminFormSet(inline, formset,
-                fieldsets, readonly, model_admin=self)
+                fieldsets, prepopulated, readonly, model_admin=self)
             inline_admin_formsets.append(inline_admin_formset)
             media = media + inline_admin_formset.media
 
@@ -989,7 +997,8 @@
                 formsets.append(formset)
 
         adminForm = helpers.AdminForm(form, self.get_fieldsets(request, obj),
-            self.prepopulated_fields, self.get_readonly_fields(request, obj),
+            self.get_prepopulated_fields(request, obj),
+            self.get_readonly_fields(request, obj),
             model_admin=self)
         media = self.media + adminForm.media
 
@@ -997,8 +1006,9 @@
         for inline, formset in zip(self.inline_instances, formsets):
             fieldsets = list(inline.get_fieldsets(request, obj))
             readonly = list(inline.get_readonly_fields(request, obj))
+            prepopulated = dict(inline.get_prepopulated_fields(request, obj))
             inline_admin_formset = helpers.InlineAdminFormSet(inline, formset,
-                fieldsets, readonly, model_admin=self)
+                fieldsets, prepopulated, readonly, model_admin=self)
             inline_admin_formsets.append(inline_admin_formset)
             media = media + inline_admin_formset.media
 
Index: django/contrib/admin/helpers.py
===================================================================
--- django/contrib/admin/helpers.py	(revision 15481)
+++ django/contrib/admin/helpers.py	(working copy)
@@ -192,7 +192,8 @@
     """
     A wrapper around an inline formset for use in the admin system.
     """
-    def __init__(self, inline, formset, fieldsets, readonly_fields=None, model_admin=None):
+    def __init__(self, inline, formset, fieldsets, prepopulated_fields=None,
+      readonly_fields=None, model_admin=None):
         self.opts = inline
         self.formset = formset
         self.fieldsets = fieldsets
@@ -200,18 +201,21 @@
         if readonly_fields is None:
             readonly_fields = ()
         self.readonly_fields = readonly_fields
+        if prepopulated_fields is None:
+            prepopulated_fields = {}
+        self.prepopulated_fields = prepopulated_fields
 
     def __iter__(self):
         for form, original in zip(self.formset.initial_forms, self.formset.get_queryset()):
             yield InlineAdminForm(self.formset, form, self.fieldsets,
-                self.opts.prepopulated_fields, original, self.readonly_fields,
+                self.prepopulated_fields, original, self.readonly_fields,
                 model_admin=self.model_admin)
         for form in self.formset.extra_forms:
             yield InlineAdminForm(self.formset, form, self.fieldsets,
-                self.opts.prepopulated_fields, None, self.readonly_fields,
+                self.prepopulated_fields, None, self.readonly_fields,
                 model_admin=self.model_admin)
         yield InlineAdminForm(self.formset, self.formset.empty_form,
-            self.fieldsets, self.opts.prepopulated_fields, None,
+            self.fieldsets, self.prepopulated_fields, None,
             self.readonly_fields, model_admin=self.model_admin)
 
     def fields(self):
Index: tests/regressiontests/admin_views/fixtures/admin-views-users.xml
===================================================================
--- tests/regressiontests/admin_views/fixtures/admin-views-users.xml	(revision 15481)
+++ tests/regressiontests/admin_views/fixtures/admin-views-users.xml	(working copy)
@@ -88,6 +88,9 @@
         <field type="DateTimeField" name="date">2009-03-18 11:54:58</field>
         <field to="admin_views.section" name="section" rel="ManyToOneRel">1</field>
     </object>
-
-
-</django-objects>
\ No newline at end of file
+    <object pk="1" model="admin_views.prepopulatedpost">
+        <field type="TextField" name="title">A Long Title</field>
+        <field type="BooleanField" name="published">True</field>
+        <field type="SlugField" name="slug">a-long-title</field>
+    </object>
+</django-objects>
Index: tests/regressiontests/admin_views/tests.py
===================================================================
--- tests/regressiontests/admin_views/tests.py	(revision 15481)
+++ tests/regressiontests/admin_views/tests.py	(working copy)
@@ -2361,6 +2361,30 @@
         self.assertEqual(get_max_age(response), None)
 
 
+class PrePopulatedTest(TestCase):
+    fixtures = ['admin-views-users.xml']
+
+    def setUp(self):
+        self.client.login(username='super', password='secret')
+
+    def tearDown(self):
+        self.client.logout()
+
+    def test_prepopulated_on(self):
+        response = self.client.get('/test_admin/admin/admin_views/prepopulatedpost/add/')
+        self.assertEqual(response.status_code, 200)
+        self.assertContains(response, "id: '#id_slug',")
+        self.assertContains(response, "field['dependency_ids'].push('#id_title');")
+        self.assertContains(response, "id: '#id_prepopulatedsubpost_set-0-subslug',")
+
+    def test_prepopulated_off(self):
+        response = self.client.get('/test_admin/admin/admin_views/prepopulatedpost/1/')
+        self.assertEqual(response.status_code, 200)
+        self.assertContains(response, "A Long Title")
+        self.assertNotContains(response, "id: '#id_slug'")
+        self.assertNotContains(response, "field['dependency_ids'].push('#id_title');")
+        self.assertNotContains(response, "id: '#id_prepopulatedsubpost_set-0-subslug',")
+
 class ReadonlyTest(TestCase):
     fixtures = ['admin-views-users.xml']
 
Index: tests/regressiontests/admin_views/models.py
===================================================================
--- tests/regressiontests/admin_views/models.py	(revision 15481)
+++ tests/regressiontests/admin_views/models.py	(working copy)
@@ -522,6 +522,47 @@
     readonly_fields = ("posted",)
 
 
+class PrePopulatedPost(models.Model):
+    title = models.CharField(max_length=100)
+    published = models.BooleanField()
+    slug = models.SlugField()
+
+class PrePopulatedSubPost(models.Model):
+    post = models.ForeignKey(PrePopulatedPost)
+    subtitle = models.CharField(max_length=100)
+    subslug = models.SlugField()
+
+class SubPostInline(admin.TabularInline):
+    model = PrePopulatedSubPost
+
+    prepopulated_fields = { 'subslug' : ('subtitle',) }
+
+    def get_readonly_fields(self, request, obj=None):
+        if obj and obj.published:
+                return ('subslug',)
+        return self.readonly_fields
+
+    def get_prepopulated_fields(self, request, obj=None):
+        if obj and obj.published:
+                return {}
+        return self.prepopulated_fields
+
+class PrePopulatedPostAdmin(admin.ModelAdmin):
+    list_display = ['title', 'slug']
+    prepopulated_fields = { 'slug' : ('title',) }
+
+    inlines = [ SubPostInline ]
+
+    def get_readonly_fields(self, request, obj=None):
+        if obj and obj.published:
+                return ('slug',)
+        return self.readonly_fields
+
+    def get_prepopulated_fields(self, request, obj=None):
+        if obj and obj.published:
+                return {}
+        return self.prepopulated_fields
+
 class Post(models.Model):
     title = models.CharField(max_length=100)
     content = models.TextField()
@@ -724,3 +765,4 @@
 admin.site.register(Album, AlbumAdmin)
 admin.site.register(Question)
 admin.site.register(Answer)
+admin.site.register(PrePopulatedPost, PrePopulatedPostAdmin)
