Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14038 -- Added information to release notes and version change…

…d|added markers to documentation additions for the new template loeaders API introduced in version 1.2. Thanks 3point2 for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15309 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f81d4ba5b3deceeacbe51923f379acb7d033665f 1 parent 5d2ea79
Ramiro Morales authored January 25, 2011
6  docs/ref/settings.txt
@@ -1743,6 +1743,12 @@ used instead of a string. The first item in the tuple should be the ``Loader``'s
1743 1743
 module, subsequent items are passed to the ``Loader`` during initialization. See
1744 1744
 :doc:`/ref/templates/api`.
1745 1745
 
  1746
+.. versionchanged:: 1.2
  1747
+    The class-based API for template loaders was introduced in Django 1.2
  1748
+    although  the ``TEMPLATE_LOADERS`` setting will accept strings that specify
  1749
+    function-based loaders until compatibility with them is completely removed in
  1750
+    Django 1.4.
  1751
+
1746 1752
 .. setting:: TEMPLATE_STRING_IF_INVALID
1747 1753
 
1748 1754
 TEMPLATE_STRING_IF_INVALID
9  docs/ref/templates/api.txt
@@ -630,8 +630,13 @@ sources.
630 630
 
631 631
 Some of these other loaders are disabled by default, but you can activate them
632 632
 by editing your :setting:`TEMPLATE_LOADERS` setting. :setting:`TEMPLATE_LOADERS`
633  
-should be a tuple of strings, where each string represents a template loader.
634  
-Here are the template loaders that come with Django:
  633
+should be a tuple of strings, where each string represents a template loader
  634
+class. Here are the template loaders that come with Django:
  635
+
  636
+.. versionchanged:: 1.2
  637
+    Template loaders were based on callables (usually functions) before Django
  638
+    1.2, starting with the 1.2 release there is a new class-based API, all the
  639
+    loaders described below implement this new API.
635 640
 
636 641
 ``django.template.loaders.filesystem.Loader``
637 642
     Loads templates from the filesystem, according to :setting:`TEMPLATE_DIRS`.
30  docs/releases/1.2.txt
@@ -256,6 +256,29 @@ As a side effect, it is now much easier to support non-Django template
256 256
 languages. For more details, see the :ref:`notes on supporting
257 257
 non-Django template languages<topic-template-alternate-language>`.
258 258
 
  259
+Class-based template loaders
  260
+----------------------------
  261
+
  262
+As part of the changes made to introduce `Template caching`_  and following
  263
+a general trend in Django, the template loaders API has been modified
  264
+to use template loading mechanisms that are encapsulated in Python classes as
  265
+opposed to functions, the only method available until Django 1.1.
  266
+
  267
+All the template loaders :ref:`shipped with Django <template-loaders>` have
  268
+been ported to the new API but they still implement the function-based API and
  269
+the template core machinery still accepts function-based loaders (builtin or
  270
+third party) so there is no immediate need to modify your
  271
+:setting:`TEMPLATE_LOADERS` setting in existing projects, things will keep
  272
+working if you leave it untouched up to and including the Django 1.3 release.
  273
+
  274
+If you have developed your own custom template loaders we suggest to consider
  275
+porting them to a class-based implementation because the code for backwards
  276
+compatibility with function-based loaders starts its deprecation process in
  277
+Django 1.2 and will be removed in Django 1.4.  There is a description of the
  278
+API these loader classes must implement :ref:`here
  279
+<topic-template-alternate-language>` and you can also examine the source code
  280
+of the loaders shipped with Django.
  281
+
259 282
 Natural keys in fixtures
260 283
 ------------------------
261 284
 
@@ -1137,3 +1160,10 @@ Language code ``no``
1137 1160
 The currently used language code for Norwegian Bokmål ``no`` is being
1138 1161
 replaced by the more common language code ``nb``.
1139 1162
 
  1163
+Function-based template loaders
  1164
+-------------------------------
  1165
+
  1166
+Django 1.2 changes the template loading mechanism to use a class-based
  1167
+approach. Old style function-based template loaders will still work, but should
  1168
+be updated to use the new :ref:`class-based template loaders
  1169
+<topic-template-alternate-language>`.

0 notes on commit f81d4ba

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