diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-12-29 23:51:25 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-06 22:02:26 +0100 |
| commit | ed220c4cbea04c2e77535af93bcfaa917cce607a (patch) | |
| tree | e282894ca2127043a2b8ef6f6e68d08f5cde1625 | |
| parent | 2e65d56156b622e2393dee1af66e9c799a51924f (diff) | |
Added comments to remove Engine.render_to_string in Django 2.0.
Since this is a private API introduced in Django 1.8, no documentation
is required.
| -rw-r--r-- | django/template/engine.py | 12 | ||||
| -rw-r--r-- | django/template/loader.py | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/django/template/engine.py b/django/template/engine.py index 9fecabb259..9e9feb70fa 100644 --- a/django/template/engine.py +++ b/django/template/engine.py @@ -171,16 +171,16 @@ class Engine(object): template = Template(template, origin, template_name, engine=self) return template + # This method was originally a function defined in django.template.loader. + # It was moved here in Django 1.8 when encapsulating the Django template + # engine in this Engine class. It's still called by deprecated code but it + # will be removed in Django 2.0. It's superseded by a new render_to_string + # function in django.template.loader. + def render_to_string(self, template_name, context=None, context_instance=_context_instance_undefined, dirs=_dirs_undefined, dictionary=_dictionary_undefined): - """ - Loads the given template_name and renders it with the given dictionary as - context. The template_name may be a string to load a single template using - get_template, or it may be a tuple to use select_template to find one of - the templates in the list. Returns a string. - """ if context_instance is _context_instance_undefined: context_instance = None else: diff --git a/django/template/loader.py b/django/template/loader.py index 0bc64e4d7d..d93b5e6b2b 100644 --- a/django/template/loader.py +++ b/django/template/loader.py @@ -100,9 +100,9 @@ def render_to_string(template_name, context=None, # Some deprecated arguments were passed - use the legacy code path for engine in _engine_list(using): try: - # This is required for deprecating arguments specific to Django - # templates. Simply return engine.render_to_string(template_name, - # context) in Django 2.0. + # This is required for deprecating properly arguments specific + # to Django templates. Remove Engine.render_to_string() at the + # same time as this code path in Django 2.0. if isinstance(engine, DjangoTemplates): # Hack -- use the internal Engine instance of DjangoTemplates. return engine.engine.render_to_string( |
