Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #1041 -- Generic views no longer use deprecated template_loader…

…. Thanks for the patch, Ian

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5cbbd364c3db2b72b8b0698d5321ce23a435c1d2 1 parent 0c6653c
@adrianholovaty adrianholovaty authored
View
9 django/views/generic/create_update.py
@@ -1,6 +1,7 @@
from django import models
from django.core.xheaders import populate_xheaders
-from django.core import template_loader, formfields, meta
+from django.core.template import loader
+from django.core import formfields, meta
from django.views.auth.login import redirect_to_login
from django.core.extensions import DjangoContext as Context
from django.core.paginator import ObjectPaginator, InvalidPage
@@ -8,7 +9,7 @@
from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured
def create_object(request, app_label, module_name, template_name=None,
- template_loader=template_loader, extra_context={},
+ template_loader=loader, extra_context={},
post_save_redirect=None, login_required=False, follow=None):
"""
Generic object-creation function.
@@ -70,7 +71,7 @@ def create_object(request, app_label, module_name, template_name=None,
return HttpResponse(t.render(c))
def update_object(request, app_label, module_name, object_id=None, slug=None,
- slug_field=None, template_name=None, template_loader=template_loader,
+ slug_field=None, template_name=None, template_loader=loader,
extra_lookup_kwargs={}, extra_context={}, post_save_redirect=None,
login_required=False, follow=None):
"""
@@ -145,7 +146,7 @@ def update_object(request, app_label, module_name, object_id=None, slug=None,
def delete_object(request, app_label, module_name, post_delete_redirect,
object_id=None, slug=None, slug_field=None, template_name=None,
- template_loader=template_loader, extra_lookup_kwargs={},
+ template_loader=loader, extra_lookup_kwargs={},
extra_context={}, login_required=False):
"""
Generic object-delete function.
View
12 django/views/generic/date_based.py
@@ -1,4 +1,4 @@
-from django.core import template_loader
+from django.core.template import loader
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.extensions import DjangoContext as Context
from django.core.xheaders import populate_xheaders
@@ -7,7 +7,7 @@
import datetime, time
def archive_index(request, app_label, module_name, date_field, num_latest=15,
- template_name=None, template_loader=template_loader,
+ template_name=None, template_loader=loader,
extra_lookup_kwargs={}, extra_context={}, allow_empty=False):
"""
Generic top-level archive of date-based objects.
@@ -50,7 +50,7 @@ def archive_index(request, app_label, module_name, date_field, num_latest=15,
return HttpResponse(t.render(c))
def archive_year(request, year, app_label, module_name, date_field,
- template_name=None, template_loader=template_loader,
+ template_name=None, template_loader=loader,
extra_lookup_kwargs={}, extra_context={}):
"""
Generic yearly archive view.
@@ -87,7 +87,7 @@ def archive_year(request, year, app_label, module_name, date_field,
return HttpResponse(t.render(c))
def archive_month(request, year, month, app_label, module_name, date_field,
- month_format='%b', template_name=None, template_loader=template_loader,
+ month_format='%b', template_name=None, template_loader=loader,
extra_lookup_kwargs={}, extra_context={}):
"""
Generic monthly archive view.
@@ -136,7 +136,7 @@ def archive_month(request, year, month, app_label, module_name, date_field,
def archive_day(request, year, month, day, app_label, module_name, date_field,
month_format='%b', day_format='%d', template_name=None,
- template_loader=template_loader, extra_lookup_kwargs={},
+ template_loader=loader, extra_lookup_kwargs={},
extra_context={}, allow_empty=False):
"""
Generic daily archive view.
@@ -200,7 +200,7 @@ def archive_today(request, **kwargs):
def object_detail(request, year, month, day, app_label, module_name, 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=template_loader, extra_lookup_kwargs={},
+ template_loader=loader, extra_lookup_kwargs={},
extra_context={}):
"""
Generic detail view from year/month/day/slug or year/month/day/id structure.
View
6 django/views/generic/list_detail.py
@@ -1,5 +1,5 @@
from django import models
-from django.core import template_loader
+from django.core.template import loader
from django.utils.httpwrappers import HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.extensions import DjangoContext as Context
@@ -7,7 +7,7 @@
from django.core.exceptions import Http404, ObjectDoesNotExist
def object_list(request, app_label, module_name, paginate_by=None, allow_empty=False,
- template_name=None, template_loader=template_loader,
+ template_name=None, template_loader=loader,
extra_lookup_kwargs={}, extra_context={}):
"""
Generic list of objects.
@@ -80,7 +80,7 @@ def object_list(request, app_label, module_name, paginate_by=None, allow_empty=F
def object_detail(request, app_label, module_name, object_id=None, slug=None,
slug_field=None, template_name=None, template_name_field=None,
- template_loader=template_loader, extra_lookup_kwargs={},
+ template_loader=loader, extra_lookup_kwargs={},
extra_context={}):
"""
Generic list of objects.

0 comments on commit 5cbbd36

Please sign in to comment.
Something went wrong with that request. Please try again.