summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-04-02 08:41:03 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-04-02 08:41:03 +0000
commit4d94c0cb38624115299e19daae24d2312e60e273 (patch)
treef64e3e1f8d9c7a17c08eed605061aa65f40e4209
parent1d4390b26b9e9ac05b89c7c1b51e5cd912d842ea (diff)
Advanced deprecations in django.template.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/template/defaulttags.py4
-rw-r--r--django/template/loader.py12
-rw-r--r--django/template/loaders/app_directories.py10
-rw-r--r--django/template/loaders/eggs.py9
-rw-r--r--django/template/loaders/filesystem.py10
5 files changed, 2 insertions, 43 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 8f46c7ff11..f4018ab427 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -989,7 +989,7 @@ def ssi(parser, token):
import warnings
warnings.warn('The syntax for the ssi template tag is changing. Load the `ssi` tag from the `future` tag library to start using the new behavior.',
- category=PendingDeprecationWarning)
+ category=DeprecationWarning)
bits = token.contents.split()
parsed = False
@@ -1240,7 +1240,7 @@ def url(parser, token):
import warnings
warnings.warn('The syntax for the url template tag is changing. Load the `url` tag from the `future` tag library to start using the new behavior.',
- category=PendingDeprecationWarning)
+ category=DeprecationWarning)
bits = token.split_contents()
if len(bits) < 2:
diff --git a/django/template/loader.py b/django/template/loader.py
index 98eddf24f2..e10533393d 100644
--- a/django/template/loader.py
+++ b/django/template/loader.py
@@ -137,18 +137,6 @@ def find_template(name, dirs=None):
pass
raise TemplateDoesNotExist(name)
-def find_template_source(name, dirs=None):
- # For backward compatibility
- import warnings
- warnings.warn(
- "`django.template.loader.find_template_source` is deprecated; use `django.template.loader.find_template` instead.",
- DeprecationWarning
- )
- template, origin = find_template(name, dirs)
- if hasattr(template, 'render'):
- raise Exception("Found a compiled template that is incompatible with the deprecated `django.template.loader.find_template_source` function.")
- return template, origin
-
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
diff --git a/django/template/loaders/app_directories.py b/django/template/loaders/app_directories.py
index 475ece812f..b0560b4121 100644
--- a/django/template/loaders/app_directories.py
+++ b/django/template/loaders/app_directories.py
@@ -62,13 +62,3 @@ class Loader(BaseLoader):
raise TemplateDoesNotExist(template_name)
_loader = Loader()
-
-def load_template_source(template_name, template_dirs=None):
- # For backwards compatibility
- import warnings
- warnings.warn(
- "'django.template.loaders.app_directories.load_template_source' is deprecated; use 'django.template.loaders.app_directories.Loader' instead.",
- DeprecationWarning
- )
- return _loader.load_template_source(template_name, template_dirs)
-load_template_source.is_usable = True
diff --git a/django/template/loaders/eggs.py b/django/template/loaders/eggs.py
index df54a41fe8..42f87a459e 100644
--- a/django/template/loaders/eggs.py
+++ b/django/template/loaders/eggs.py
@@ -28,12 +28,3 @@ class Loader(BaseLoader):
raise TemplateDoesNotExist(template_name)
_loader = Loader()
-
-def load_template_source(template_name, template_dirs=None):
- import warnings
- warnings.warn(
- "'django.template.loaders.eggs.load_template_source' is deprecated; use 'django.template.loaders.eggs.Loader' instead.",
- DeprecationWarning
- )
- return _loader.load_template_source(template_name, template_dirs)
-load_template_source.is_usable = resource_string is not None
diff --git a/django/template/loaders/filesystem.py b/django/template/loaders/filesystem.py
index b12dcf8fba..51025acfd5 100644
--- a/django/template/loaders/filesystem.py
+++ b/django/template/loaders/filesystem.py
@@ -49,13 +49,3 @@ class Loader(BaseLoader):
load_template_source.is_usable = True
_loader = Loader()
-
-def load_template_source(template_name, template_dirs=None):
- # For backwards compatibility
- import warnings
- warnings.warn(
- "'django.template.loaders.filesystem.load_template_source' is deprecated; use 'django.template.loaders.filesystem.Loader' instead.",
- DeprecationWarning
- )
- return _loader.load_template_source(template_name, template_dirs)
-load_template_source.is_usable = True