Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored December 16, 2005
9  django/views/generic/create_update.py
... ...
@@ -1,6 +1,7 @@
1 1
 from django import models
2 2
 from django.core.xheaders import populate_xheaders
3  
-from django.core import template_loader, formfields, meta
  3
+from django.core.template import loader
  4
+from django.core import formfields, meta
4 5
 from django.views.auth.login import redirect_to_login
5 6
 from django.core.extensions import DjangoContext as Context
6 7
 from django.core.paginator import ObjectPaginator, InvalidPage
@@ -8,7 +9,7 @@
8 9
 from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured
9 10
 
10 11
 def create_object(request, app_label, module_name, template_name=None,
11  
-                 template_loader=template_loader, extra_context={},
  12
+                 template_loader=loader, extra_context={},
12 13
                  post_save_redirect=None, login_required=False, follow=None):
13 14
     """
14 15
     Generic object-creation function.
@@ -70,7 +71,7 @@ def create_object(request, app_label, module_name, template_name=None,
70 71
     return HttpResponse(t.render(c))
71 72
 
72 73
 def update_object(request, app_label, module_name, object_id=None, slug=None,
73  
-                  slug_field=None, template_name=None, template_loader=template_loader,
  74
+                  slug_field=None, template_name=None, template_loader=loader,
74 75
                   extra_lookup_kwargs={}, extra_context={}, post_save_redirect=None,
75 76
                   login_required=False, follow=None):
76 77
     """
@@ -145,7 +146,7 @@ def update_object(request, app_label, module_name, object_id=None, slug=None,
145 146
 
146 147
 def delete_object(request, app_label, module_name, post_delete_redirect,
147 148
                   object_id=None, slug=None, slug_field=None, template_name=None,
148  
-                  template_loader=template_loader, extra_lookup_kwargs={},
  149
+                  template_loader=loader, extra_lookup_kwargs={},
149 150
                   extra_context={}, login_required=False):
150 151
     """
151 152
     Generic object-delete function.
12  django/views/generic/date_based.py
... ...
@@ -1,4 +1,4 @@
1  
-from django.core import template_loader
  1
+from django.core.template import loader
2 2
 from django.core.exceptions import Http404, ObjectDoesNotExist
3 3
 from django.core.extensions import DjangoContext as Context
4 4
 from django.core.xheaders import populate_xheaders
@@ -7,7 +7,7 @@
7 7
 import datetime, time
8 8
 
9 9
 def archive_index(request, app_label, module_name, date_field, num_latest=15,
10  
-                  template_name=None, template_loader=template_loader,
  10
+                  template_name=None, template_loader=loader,
11 11
                   extra_lookup_kwargs={}, extra_context={}, allow_empty=False):
12 12
     """
13 13
     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,
50 50
     return HttpResponse(t.render(c))
51 51
 
52 52
 def archive_year(request, year, app_label, module_name, date_field,
53  
-                 template_name=None, template_loader=template_loader,
  53
+                 template_name=None, template_loader=loader,
54 54
                  extra_lookup_kwargs={}, extra_context={}):
55 55
     """
56 56
     Generic yearly archive view.
@@ -87,7 +87,7 @@ def archive_year(request, year, app_label, module_name, date_field,
87 87
     return HttpResponse(t.render(c))
88 88
 
89 89
 def archive_month(request, year, month, app_label, module_name, date_field,
90  
-                  month_format='%b', template_name=None, template_loader=template_loader,
  90
+                  month_format='%b', template_name=None, template_loader=loader,
91 91
                   extra_lookup_kwargs={}, extra_context={}):
92 92
     """
93 93
     Generic monthly archive view.
@@ -136,7 +136,7 @@ def archive_month(request, year, month, app_label, module_name, date_field,
136 136
 
137 137
 def archive_day(request, year, month, day, app_label, module_name, date_field,
138 138
                 month_format='%b', day_format='%d', template_name=None,
139  
-                template_loader=template_loader, extra_lookup_kwargs={},
  139
+                template_loader=loader, extra_lookup_kwargs={},
140 140
                 extra_context={}, allow_empty=False):
141 141
     """
142 142
     Generic daily archive view.
@@ -200,7 +200,7 @@ def archive_today(request, **kwargs):
200 200
 def object_detail(request, year, month, day, app_label, module_name, date_field,
201 201
                   month_format='%b', day_format='%d', object_id=None, slug=None,
202 202
                   slug_field=None, template_name=None, template_name_field=None,
203  
-                  template_loader=template_loader, extra_lookup_kwargs={},
  203
+                  template_loader=loader, extra_lookup_kwargs={},
204 204
                   extra_context={}):
205 205
     """
206 206
     Generic detail view from year/month/day/slug or year/month/day/id structure.
6  django/views/generic/list_detail.py
... ...
@@ -1,5 +1,5 @@
1 1
 from django import models
2  
-from django.core import template_loader
  2
+from django.core.template import loader
3 3
 from django.utils.httpwrappers import HttpResponse
4 4
 from django.core.xheaders import populate_xheaders
5 5
 from django.core.extensions import DjangoContext as Context
@@ -7,7 +7,7 @@
7 7
 from django.core.exceptions import Http404, ObjectDoesNotExist
8 8
 
9 9
 def object_list(request, app_label, module_name, paginate_by=None, allow_empty=False,
10  
-                template_name=None, template_loader=template_loader,
  10
+                template_name=None, template_loader=loader,
11 11
                 extra_lookup_kwargs={}, extra_context={}):
12 12
     """
13 13
     Generic list of objects.
@@ -80,7 +80,7 @@ def object_list(request, app_label, module_name, paginate_by=None, allow_empty=F
80 80
 
81 81
 def object_detail(request, app_label, module_name, object_id=None, slug=None,
82 82
                   slug_field=None, template_name=None, template_name_field=None,
83  
-                  template_loader=template_loader, extra_lookup_kwargs={},
  83
+                  template_loader=loader, extra_lookup_kwargs={},
84 84
                   extra_context={}):
85 85
     """
86 86
     Generic list of objects.

0 notes on commit 5cbbd36

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