Skip to content

Commit

Permalink
Advanced deprecations in django.template.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Apr 2, 2011
1 parent 1d4390b commit 4d94c0c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 43 deletions.
4 changes: 2 additions & 2 deletions django/template/defaulttags.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 0 additions & 12 deletions django/template/loader.py
Expand Up @@ -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,
Expand Down
10 changes: 0 additions & 10 deletions django/template/loaders/app_directories.py
Expand Up @@ -62,13 +62,3 @@ def load_template_source(self, template_name, template_dirs=None):
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
9 changes: 0 additions & 9 deletions django/template/loaders/eggs.py
Expand Up @@ -28,12 +28,3 @@ def load_template_source(self, template_name, template_dirs=None):
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
10 changes: 0 additions & 10 deletions django/template/loaders/filesystem.py
Expand Up @@ -49,13 +49,3 @@ def load_template_source(self, template_name, template_dirs=None):
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

0 comments on commit 4d94c0c

Please sign in to comment.