=== modified file 'django/contrib/admin/options.py'
--- django/contrib/admin/options.py	2007-12-06 10:09:52 +0000
+++ django/contrib/admin/options.py	2007-12-06 18:43:21 +0000
@@ -452,9 +452,8 @@
             request.user.message_set.create(message=msg)
             return HttpResponseRedirect("../")
 
-    def render_change_form(self, request, model, context, add=False, change=False, obj=None):
+    def render_change_form(self, request, model, template_name, context, add=False, change=False, obj=None):
         opts = model._meta
-        app_label = opts.app_label
         ordered_objects = opts.get_ordered_objects()
         extra_context = {
             'add': add,
@@ -472,16 +471,12 @@
             'is_save_as': request.POST.has_key('_saveasnew'),
         }
         context.update(extra_context)
-        return render_to_response([
-            "admin/%s/%s/change_form.html" % (app_label, opts.object_name.lower()),
-            "admin/%s/change_form.html" % app_label,
-            "admin/change_form.html"], context_instance=context)
+        return render_to_response(template_name, context_instance=context)
 
     def add_view(self, request):
         "The 'add' admin view for this model."
         model = self.model
         opts = model._meta
-        app_label = opts.app_label
 
         if not self.has_add_permission(request):
             raise PermissionDenied
@@ -528,13 +523,12 @@
             'inline_admin_formsets': inline_admin_formsets,
         })
         c.update(self.add_view_extra_context(request))
-        return self.render_change_form(request, model, c, add=True)
+        return self.render_change_form(request, model, self.add_view_template_name(request), c, add=True)
 
     def change_view(self, request, object_id):
         "The 'change' admin view for this model."
         model = self.model
         opts = model._meta
-        app_label = opts.app_label
 
         try:
             obj = model._default_manager.get(pk=object_id)
@@ -604,13 +598,11 @@
             'inline_admin_formsets': inline_admin_formsets,
         })
         c.update(self.change_view_extra_context(request, obj))
-        return self.render_change_form(request, model, c, change=True, obj=obj)
+        return self.render_change_form(request, model, self.change_view_template_name(request, obj), c, change=True, obj=obj)
 
     def changelist_view(self, request):
         "The 'change list' admin view for this model."
         from django.contrib.admin.views.main import ChangeList, ERROR_FLAG
-        opts = self.model._meta
-        app_label = opts.app_label
         if not self.has_change_permission(request, None):
             raise PermissionDenied
         try:
@@ -632,16 +624,14 @@
         })
         c.update({'has_add_permission': self.has_add_permission(request)}),
         c.update(self.changelist_view_extra_context(request, cl))
-        return render_to_response(['admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
-                                'admin/%s/change_list.html' % app_label,
-                                'admin/change_list.html'], context_instance=c)
+        return render_to_response(self.changelist_view_template_name(request, cl),
+            context_instance=c)
 
     def delete_view(self, request, object_id):
         "The 'delete' admin view for this model."
         from django.contrib.contenttypes.models import ContentType
         from django.contrib.admin.models import LogEntry, DELETION
         opts = self.model._meta
-        app_label = opts.app_label
 
         try:
             obj = self.model._default_manager.get(pk=object_id)
@@ -680,9 +670,8 @@
             "opts": opts,
         }
         extra_context.update(self.delete_view_extra_context(request, obj))
-        return render_to_response(["admin/%s/%s/delete_confirmation.html" % (app_label, opts.object_name.lower() ),
-                                "admin/%s/delete_confirmation.html" % app_label ,
-                                "admin/delete_confirmation.html"], extra_context, context_instance=template.RequestContext(request))
+        return render_to_response(self.delete_view_template_name(request, obj),
+            extra_context, context_instance=template.RequestContext(request))
 
     def history_view(self, request, object_id):
         "The 'history' admin view for this model."
@@ -700,13 +689,9 @@
             'module_name': capfirst(opts.verbose_name_plural),
             'object': obj,
         }
-        template_list = [
-            "admin/%s/%s/object_history.html" % (opts.app_label, opts.object_name.lower()),
-            "admin/%s/object_history.html" % opts.app_label,
-            "admin/object_history.html"
-        ]
         extra_context.update(self.history_view_extra_context(request, obj))
-        return render_to_response(template_list, extra_context, context_instance=template.RequestContext(request))
+        return render_to_response(self.history_view_template_name(request, obj),
+            extra_context, context_instance=template.RequestContext(request))
 
     def formsets_add(self, request):
         for inline in self.inline_instances:
@@ -736,6 +721,47 @@
         """ Extra context for the 'history' admin view. """
         return {}
 
+    def add_view_template_name(self, request):
+        """ Template name for the 'add' admin view. """
+        opts = self.opts
+        return [
+            'admin/%s/%s/change_form.html' % (opts.app_label, opts.object_name.lower()),
+            'admin/%s/change_form.html' % opts.app_label,
+            'admin/change_form.html']
+
+    def change_view_template_name(self, request, obj):
+        """ Template name for the 'change' admin view. """
+        opts = self.opts
+        return [
+            'admin/%s/%s/change_form.html' % (opts.app_label, opts.object_name.lower()),
+            'admin/%s/change_form.html' % opts.app_label,
+            'admin/change_form.html']
+
+    def changelist_view_template_name(self, request, cl):
+        """ Template name for the 'change list' admin view. """
+        opts = self.opts
+        return [
+            'admin/%s/%s/change_list.html' % (opts.app_label, opts.object_name.lower()),
+            'admin/%s/change_list.html' % opts.app_label,
+            'admin/change_list.html']
+
+    def delete_view_template_name(self, request, obj):
+        """ Template name for the 'delete' admin view. """
+        opts = self.opts
+        return [
+            'admin/%s/%s/delete_confirmation.html' % (opts.app_label, opts.object_name.lower()),
+            'admin/%s/delete_confirmation.html' % opts.app_label,
+            'admin/delete_confirmation.html']
+
+    def history_view_template_name(self, request, obj):
+        """ Template name for the 'history' admin view. """
+        opts = self.opts
+        return [
+            'admin/%s/%s/object_history.html' % (opts.app_label, opts.object_name.lower()),
+            'admin/%s/object_history.html' % opts.app_label,
+            'admin/object_history.html'
+        ]
+
 class InlineModelAdmin(BaseModelAdmin):
     """
     Options for inline editing of ``model`` instances.

=== modified file 'django/contrib/admin/sites.py'
--- django/contrib/admin/sites.py	2007-12-05 16:24:59 +0000
+++ django/contrib/admin/sites.py	2007-12-05 16:27:27 +0000
@@ -298,13 +298,17 @@
               'app_list': app_list,
         }
         context.update(self.index_view_extra_context(request))
-        return render_to_response('admin/index.html', context,
+        return render_to_response(self.index_view_template_name(request), context,
             context_instance=template.RequestContext(request))
         
     def index_view_extra_context(self, request):
         """ Extra context for the 'index' admin view. """
         return {}
 
+    def index_view_template_name(self, request):
+        """ Template name for the 'delete' admin view. """
+        return 'admin/index.html'
+
 # This global object represents the default admin site, for the common case.
 # You can instantiate AdminSite in your own code to create a custom admin site.
 site = AdminSite()

