1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Remove leading underscore from a function that's all growed up now.

This function is now the de facto standard function for rendering values in a
template, and is imported by two other built-in template modules. It shouldn't
have a leading underscore.
This commit is contained in:
Carl Meyer
2013-02-25 00:33:29 -07:00
parent 8f839aaa18
commit 3ded2aef71
3 changed files with 8 additions and 8 deletions

View File

@@ -861,7 +861,7 @@ class TextNode(Node):
def render(self, context):
return self.s
def _render_value_in_context(value, context):
def render_value_in_context(value, context):
"""
Converts any value to a string to become part of a rendered template. This
means escaping, if required, and conversion to a unicode object. If value
@@ -891,7 +891,7 @@ class VariableNode(Node):
# control (e.g. exception rendering). In that case, we fail
# quietly.
return ''
return _render_value_in_context(output, context)
return render_value_in_context(output, context)
# Regex for token keyword arguments
kwarg_re = re.compile(r"(?:(\w+)=)?(.+)")

View File

@@ -13,7 +13,7 @@ from django.template.base import (Node, NodeList, Template, Context, Library,
BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END,
SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END,
VARIABLE_ATTRIBUTE_SEPARATOR, get_library, token_kwargs, kwarg_re,
_render_value_in_context)
render_value_in_context)
from django.template.smartif import IfParser, Literal
from django.template.defaultfilters import date
from django.utils.encoding import smart_text
@@ -78,7 +78,7 @@ class CycleNode(Node):
return ''
if not self.escape:
value = mark_safe(value)
return _render_value_in_context(value, context)
return render_value_in_context(value, context)
class DebugNode(Node):
def render(self, context):
@@ -111,7 +111,7 @@ class FirstOfNode(Node):
if value:
if not self.escape:
value = mark_safe(value)
return _render_value_in_context(value, context)
return render_value_in_context(value, context)
return ''
class ForNode(Node):