Index: django/core/xheaders.py
===================================================================
--- django/core/xheaders.py	(revision 1816)
+++ django/core/xheaders.py	(working copy)
@@ -4,19 +4,19 @@
 
 This module contains utility functions for retrieving and doing interesting
 things with these special "X-Headers" (so called because the HTTP spec demands
-that custom headers are prefxed with "X-").
+that custom headers are prefixed with "X-").
 
 Next time you're at slashdot.org, watch out for X-Fry and X-Bender. :)
 """
 
-def populate_xheaders(request, response, package, python_module_name, object_id):
+def populate_xheaders(request, response, object_type, object_id):
     """
     Adds the "X-Object-Type" and "X-Object-Id" headers to the given
-    HttpResponse according to the given package, python_module_name and
+    HttpResponse according to the given object_type and
     object_id -- but only if the given HttpRequest object has an IP address
     within the INTERNAL_IPS setting.
     """
     from django.conf.settings import INTERNAL_IPS
     if request.META.get('REMOTE_ADDR') in INTERNAL_IPS:
-        response['X-Object-Type'] = "%s.%s" % (package, python_module_name)
+        response['X-Object-Type'] = str(object_type)
         response['X-Object-Id'] = str(object_id)
Index: django/views/generic/date_based.py
===================================================================
--- django/views/generic/date_based.py	(revision 1816)
+++ django/views/generic/date_based.py	(working copy)
@@ -2,41 +2,40 @@
 from django.core.exceptions import Http404, ObjectDoesNotExist
 from django.core.extensions import DjangoContext
 from django.core.xheaders import populate_xheaders
-from django.models import get_module
 from django.utils.httpwrappers import HttpResponse
+from string import lower
 import datetime, time
 
-def archive_index(request, app_label, module_name, date_field, num_latest=15,
+def archive_index(request, app_label, model, date_field, num_latest=15,
         template_name=None, template_loader=loader, extra_lookup_kwargs={},
         extra_context={}, allow_empty=False, context_processors=None):
     """
     Generic top-level archive of date-based objects.
 
-    Templates: ``<app_label>/<module_name>_archive``
+    Templates: ``<app_label>/<model_name>_archive``
     Context:
         date_list
             List of years
         latest
             Latest N (defaults to 15) objects by date
     """
-    mod = get_module(app_label, module_name)
     lookup_kwargs = {'%s__lte' % date_field: datetime.datetime.now()}
     lookup_kwargs.update(extra_lookup_kwargs)
-    date_list = getattr(mod, "get_%s_list" % date_field)('year', **lookup_kwargs)[::-1]
+    date_list = getattr(model.objects, "get_%s_list" % date_field)('year', **lookup_kwargs)[::-1]
     if not date_list and not allow_empty:
-        raise Http404("No %s.%s available" % (app_label, module_name))
+        raise Http404("No %s available" % model.__name__)
 
     if date_list and num_latest:
         lookup_kwargs.update({
             'limit': num_latest,
             'order_by': ('-' + date_field,),
         })
-        latest = mod.get_list(**lookup_kwargs)
+        latest = model.objects.get_list(**lookup_kwargs)
     else:
         latest = None
 
     if not template_name:
-        template_name = "%s/%s_archive" % (app_label, module_name)
+        template_name = "%s/%s_archive" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'date_list' : date_list,
@@ -49,31 +48,30 @@
             c[key] = value
     return HttpResponse(t.render(c))
 
-def archive_year(request, year, app_label, module_name, date_field,
+def archive_year(request, year, app_label, model, date_field,
         template_name=None, template_loader=loader, extra_lookup_kwargs={},
         extra_context={}, context_processors=None):
     """
     Generic yearly archive view.
 
-    Templates: ``<app_label>/<module_name>_archive_year``
+    Templates: ``<app_label>/<model_name>_archive_year``
     Context:
         date_list
             List of months in this year with objects
         year
             This year
     """
-    mod = get_module(app_label, module_name)
     now = datetime.datetime.now()
     lookup_kwargs = {'%s__year' % date_field: year}
     # Only bother to check current date if the year isn't in the past.
     if int(year) >= now.year:
         lookup_kwargs['%s__lte' % date_field] = now
     lookup_kwargs.update(extra_lookup_kwargs)
-    date_list = getattr(mod, "get_%s_list" % date_field)('month', **lookup_kwargs)
+    date_list = getattr(model.objects, "get_%s_list" % date_field)('month', **lookup_kwargs)
     if not date_list:
         raise Http404
     if not template_name:
-        template_name = "%s/%s_archive_year" % (app_label, module_name)
+        template_name = "%s/%s_archive_year" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'date_list': date_list,
@@ -86,13 +84,13 @@
             c[key] = value
     return HttpResponse(t.render(c))
 
-def archive_month(request, year, month, app_label, module_name, date_field,
+def archive_month(request, year, month, app_label, model, date_field,
         month_format='%b', template_name=None, template_loader=loader,
         extra_lookup_kwargs={}, extra_context={}, context_processors=None):
     """
     Generic monthly archive view.
 
-    Templates: ``<app_label>/<module_name>_archive_month``
+    Templates: ``<app_label>/<model_name>_archive_month``
     Context:
         month:
             this month
@@ -104,7 +102,6 @@
     except ValueError:
         raise Http404
 
-    mod = get_module(app_label, module_name)
     now = datetime.datetime.now()
     # Calculate first and last day of month, for use in a date-range lookup.
     first_day = date.replace(day=1)
@@ -117,11 +114,11 @@
     if last_day >= now.date():
         lookup_kwargs['%s__lte' % date_field] = now
     lookup_kwargs.update(extra_lookup_kwargs)
-    object_list = mod.get_list(**lookup_kwargs)
+    object_list = model.objects.get_list(**lookup_kwargs)
     if not object_list:
         raise Http404
     if not template_name:
-        template_name = "%s/%s_archive_month" % (app_label, module_name)
+        template_name = "%s/%s_archive_month" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'object_list': object_list,
@@ -134,14 +131,14 @@
             c[key] = value
     return HttpResponse(t.render(c))
 
-def archive_day(request, year, month, day, app_label, module_name, date_field,
+def archive_day(request, year, month, day, app_label, model, date_field,
         month_format='%b', day_format='%d', template_name=None,
         template_loader=loader, extra_lookup_kwargs={}, extra_context={},
         allow_empty=False, context_processors=None):
     """
     Generic daily archive view.
 
-    Templates: ``<app_label>/<module_name>_archive_day``
+    Templates: ``<app_label>/<model_name>_archive_day``
     Context:
         object_list:
             list of objects published that day
@@ -157,7 +154,6 @@
     except ValueError:
         raise Http404
 
-    mod = get_module(app_label, module_name)
     now = datetime.datetime.now()
     lookup_kwargs = {
         '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)),
@@ -166,11 +162,11 @@
     if date >= now.date():
         lookup_kwargs['%s__lte' % date_field] = now
     lookup_kwargs.update(extra_lookup_kwargs)
-    object_list = mod.get_list(**lookup_kwargs)
+    object_list = model.objects.get_list(**lookup_kwargs)
     if not allow_empty and not object_list:
         raise Http404
     if not template_name:
-        template_name = "%s/%s_archive_day" % (app_label, module_name)
+        template_name = "%s/%s_archive_day" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'object_list': object_list,
@@ -197,7 +193,7 @@
     })
     return archive_day(request, **kwargs)
 
-def object_detail(request, year, month, day, app_label, module_name, date_field,
+def object_detail(request, year, month, day, app_label, model, date_field,
         month_format='%b', day_format='%d', object_id=None, slug=None,
         slug_field=None, template_name=None, template_name_field=None,
         template_loader=loader, extra_lookup_kwargs={}, extra_context={},
@@ -205,7 +201,7 @@
     """
     Generic detail view from year/month/day/slug or year/month/day/id structure.
 
-    Templates: ``<app_label>/<module_name>_detail``
+    Templates: ``<app_label>/<model_name>_detail``
     Context:
         object:
             the object to be detailed
@@ -215,7 +211,6 @@
     except ValueError:
         raise Http404
 
-    mod = get_module(app_label, module_name)
     now = datetime.datetime.now()
     lookup_kwargs = {
         '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)),
@@ -224,18 +219,18 @@
     if date >= now.date():
         lookup_kwargs['%s__lte' % date_field] = now
     if object_id:
-        lookup_kwargs['%s__exact' % mod.Klass._meta.pk.name] = object_id
+        lookup_kwargs['%s__exact' % model.Klass._meta.pk.name] = object_id
     elif slug and slug_field:
         lookup_kwargs['%s__exact' % slug_field] = slug
     else:
         raise AttributeError("Generic detail view must be called with either an object_id or a slug/slugfield")
     lookup_kwargs.update(extra_lookup_kwargs)
     try:
-        object = mod.get_object(**lookup_kwargs)
+        object = model.objects.get_object(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("%s.%s does not exist for %s" % (app_label, module_name, lookup_kwargs))
+        raise Http404("%s does not exist for %s" % (model.__name__, lookup_kwargs))
     if not template_name:
-        template_name = "%s/%s_detail" % (app_label, module_name)
+        template_name = "%s/%s_detail" % (app_label, lower(model.__name__))
     if template_name_field:
         template_name_list = [getattr(object, template_name_field), template_name]
         t = template_loader.select_template(template_name_list)
@@ -250,5 +245,5 @@
         else:
             c[key] = value
     response = HttpResponse(t.render(c))
-    populate_xheaders(request, response, app_label, module_name, getattr(object, object._meta.pk.name))
+    populate_xheaders(request, response, model.__name__, getattr(object, object._meta.pk.name))
     return response
Index: django/views/generic/list_detail.py
===================================================================
--- django/views/generic/list_detail.py	(revision 1816)
+++ django/views/generic/list_detail.py	(working copy)
@@ -5,14 +5,15 @@
 from django.core.extensions import DjangoContext
 from django.core.paginator import ObjectPaginator, InvalidPage
 from django.core.exceptions import Http404, ObjectDoesNotExist
+from string import lower
 
-def object_list(request, app_label, module_name, paginate_by=None, allow_empty=False,
+def object_list(request, app_label, model, paginate_by=None, allow_empty=False,
         template_name=None, template_loader=loader, extra_lookup_kwargs={},
         extra_context={}, context_processors=None):
     """
     Generic list of objects.
 
-    Templates: ``<app_label>/<module_name>_list``
+    Templates: ``<app_label>/<model_name>_list``
     Context:
         object_list
             list of objects
@@ -35,10 +36,9 @@
         hits
             number of objects, total
     """
-    mod = models.get_module(app_label, module_name)
     lookup_kwargs = extra_lookup_kwargs.copy()
     if paginate_by:
-        paginator = ObjectPaginator(mod, lookup_kwargs, paginate_by)
+        paginator = ObjectPaginator(model, lookup_kwargs, paginate_by)
         page = request.GET.get('page', 0)
         try:
             object_list = paginator.get_page(page)
@@ -61,7 +61,7 @@
             'hits' : paginator.hits,
         }, context_processors)
     else:
-        object_list = mod.get_list(**lookup_kwargs)
+        object_list = model.objects.get_list(**lookup_kwargs)
         c = DjangoContext(request, {
             'object_list': object_list,
             'is_paginated': False
@@ -74,23 +74,22 @@
         else:
             c[key] = value
     if not template_name:
-        template_name = "%s/%s_list" % (app_label, module_name)
+        template_name = "%s/%s_list" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     return HttpResponse(t.render(c))
 
-def object_detail(request, app_label, module_name, object_id=None, slug=None,
+def object_detail(request, app_label, model, object_id=None, slug=None,
         slug_field=None, template_name=None, template_name_field=None,
         template_loader=loader, extra_lookup_kwargs={}, extra_context={},
         context_processors=None):
     """
     Generic list of objects.
 
-    Templates: ``<app_label>/<module_name>_detail``
+    Templates: ``<app_label>/<model_name>_detail``
     Context:
         object
             the object
     """
-    mod = models.get_module(app_label, module_name)
     lookup_kwargs = {}
     if object_id:
         lookup_kwargs['pk'] = object_id
@@ -100,11 +99,11 @@
         raise AttributeError("Generic detail view must be called with either an object_id or a slug/slug_field")
     lookup_kwargs.update(extra_lookup_kwargs)
     try:
-        object = mod.get_object(**lookup_kwargs)
+        object = model.objects.get_object(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("%s.%s does not exist for %s" % (app_label, module_name, lookup_kwargs))
+        raise Http404("%s does not exist for %s" % (model.__name__, lookup_kwargs))
     if not template_name:
-        template_name = "%s/%s_detail" % (app_label, module_name)
+        template_name = "%s/%s_detail" % (app_label, lower(model.__name__))
     if template_name_field:
         template_name_list = [getattr(object, template_name_field), template_name]
         t = template_loader.select_template(template_name_list)
@@ -119,5 +118,5 @@
         else:
             c[key] = value
     response = HttpResponse(t.render(c))
-    populate_xheaders(request, response, app_label, module_name, getattr(object, object._meta.pk.name))
+    populate_xheaders(request, response, model.__name__, getattr(object, object._meta.pk.name))
     return response
Index: django/views/generic/create_update.py
===================================================================
--- django/views/generic/create_update.py	(revision 1816)
+++ django/views/generic/create_update.py	(working copy)
@@ -7,14 +7,15 @@
 from django.core.paginator import ObjectPaginator, InvalidPage
 from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect
 from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured
+from string import lower
 
-def create_object(request, app_label, module_name, template_name=None,
+def create_object(request, app_label, model, template_name=None,
         template_loader=loader, extra_context={}, post_save_redirect=None,
         login_required=False, follow=None, context_processors=None):
     """
     Generic object-creation function.
 
-    Templates: ``<app_label>/<module_name>_form``
+    Templates: ``<app_label>/<model_name>_form``
     Context:
         form
             the form wrapper for the object
@@ -22,13 +23,12 @@
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 
-    mod = models.get_module(app_label, module_name)
     manipulator = mod.AddManipulator(follow=follow)
     if request.POST:
         # If data was POSTed, we're trying to create a new object
         new_data = request.POST.copy()
 
-        if mod.Klass._meta.has_field_type(meta.FileField):
+        if model.Klass._meta.has_field_type(meta.FileField):
             new_data.update(request.FILES)
 
         # Check for errors
@@ -40,7 +40,7 @@
             new_object = manipulator.save(new_data)
 
             if not request.user.is_anonymous():
-                request.user.add_message("The %s was created sucessfully." % mod.Klass._meta.verbose_name)
+                request.user.add_message("The %s was created sucessfully." % model.Klass._meta.verbose_name)
 
             # Redirect to the new object: first by trying post_save_redirect,
             # then by obj.get_absolute_url; fail if neither works.
@@ -58,7 +58,7 @@
     # Create the FormWrapper, template, context, response
     form = formfields.FormWrapper(manipulator, new_data, errors)
     if not template_name:
-        template_name = "%s/%s_form" % (app_label, module_name)
+        template_name = "%s/%s_form" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'form': form,
@@ -70,14 +70,14 @@
             c[key] = value
     return HttpResponse(t.render(c))
 
-def update_object(request, app_label, module_name, object_id=None, slug=None,
+def update_object(request, app_label, model, object_id=None, slug=None,
         slug_field=None, template_name=None, template_loader=loader,
         extra_lookup_kwargs={}, extra_context={}, post_save_redirect=None,
         login_required=False, follow=None, context_processors=None):
     """
     Generic object-update function.
 
-    Templates: ``<app_label>/<module_name>_form``
+    Templates: ``<app_label>/<model>_form``
     Context:
         form
             the form wrapper for the object
@@ -87,23 +87,22 @@
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 
-    mod = models.get_module(app_label, module_name)
 
     # Look up the object to be edited
     lookup_kwargs = {}
     if object_id:
-        lookup_kwargs['%s__exact' % mod.Klass._meta.pk.name] = object_id
+        lookup_kwargs['%s__exact' % model.Klass._meta.pk.name] = object_id
     elif slug and slug_field:
         lookup_kwargs['%s__exact' % slug_field] = slug
     else:
         raise AttributeError("Generic edit view must be called with either an object_id or a slug/slug_field")
     lookup_kwargs.update(extra_lookup_kwargs)
     try:
-        object = mod.get_object(**lookup_kwargs)
+        object = model.objects.get_object(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("%s.%s does not exist for %s" % (app_label, module_name, lookup_kwargs))
+        raise Http404("%s does not exist for %s" % (model.__name__, lookup_kwargs))
 
-    manipulator = mod.ChangeManipulator(object.id, follow=follow)
+    manipulator = model.ChangeManipulator(object.id, follow=follow)
 
     if request.POST:
         new_data = request.POST.copy()
@@ -113,7 +112,7 @@
             manipulator.save(new_data)
 
             if not request.user.is_anonymous():
-                request.user.add_message("The %s was updated sucessfully." % mod.Klass._meta.verbose_name)
+                request.user.add_message("The %s was updated sucessfully." % model.Klass._meta.verbose_name)
 
             # Do a post-after-redirect so that reload works, etc.
             if post_save_redirect:
@@ -129,7 +128,7 @@
 
     form = formfields.FormWrapper(manipulator, new_data, errors)
     if not template_name:
-        template_name = "%s/%s_form" % (app_label, module_name)
+        template_name = "%s/%s_form" % (app_label, lower(model.__name__))
     t = template_loader.get_template(template_name)
     c = DjangoContext(request, {
         'form': form,
@@ -141,10 +140,10 @@
         else:
             c[key] = value
     response = HttpResponse(t.render(c))
-    populate_xheaders(request, response, app_label, module_name, getattr(object, object._meta.pk.name))
+    populate_xheaders(request, response, model.__name__, getattr(object, object._meta.pk.name))
     return response
 
-def delete_object(request, app_label, module_name, post_delete_redirect,
+def delete_object(request, app_label, model, post_delete_redirect,
         object_id=None, slug=None, slug_field=None, template_name=None,
         template_loader=loader, extra_lookup_kwargs={}, extra_context={},
         login_required=False, context_processors=None):
@@ -155,7 +154,7 @@
     fetched using GET; for safty, deletion will only be performed if this
     view is POSTed.
 
-    Templates: ``<app_label>/<module_name>_confirm_delete``
+    Templates: ``<app_label>/<model_name>_confirm_delete``
     Context:
         object
             the original object being deleted
@@ -163,30 +162,29 @@
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 
-    mod = models.get_module(app_label, module_name)
 
     # Look up the object to be edited
     lookup_kwargs = {}
     if object_id:
-        lookup_kwargs['%s__exact' % mod.Klass._meta.pk.name] = object_id
+        lookup_kwargs['%s__exact' % model.Klass._meta.pk.name] = object_id
     elif slug and slug_field:
         lookup_kwargs['%s__exact' % slug_field] = slug
     else:
         raise AttributeError("Generic delete view must be called with either an object_id or a slug/slug_field")
     lookup_kwargs.update(extra_lookup_kwargs)
     try:
-        object = mod.get_object(**lookup_kwargs)
+        object = model.objects.get_object(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("%s.%s does not exist for %s" % (app_label, module_name, lookup_kwargs))
+        raise Http404("%s does not exist for %s" % (model.__name__, lookup_kwargs))
 
     if request.META['REQUEST_METHOD'] == 'POST':
         object.delete()
         if not request.user.is_anonymous():
-            request.user.add_message("The %s was deleted." % mod.Klass._meta.verbose_name)
+            request.user.add_message("The %s was deleted." % model.Klass._meta.verbose_name)
         return HttpResponseRedirect(post_delete_redirect)
     else:
         if not template_name:
-            template_name = "%s/%s_confirm_delete" % (app_label, module_name)
+            template_name = "%s/%s_confirm_delete" % (app_label, lower(model.__name__))
         t = template_loader.get_template(template_name)
         c = DjangoContext(request, {
             'object': object,
@@ -197,5 +195,5 @@
             else:
                 c[key] = value
         response = HttpResponse(t.render(c))
-        populate_xheaders(request, response, app_label, module_name, getattr(object, object._meta.pk.name))
+        populate_xheaders(request, response, model.__name__, getattr(object, object._meta.pk.name))
         return response
