Changes between Initial Version and Version 5 of Ticket #27956


Ignore:
Timestamp:
Mar 21, 2017, 9:32:26 AM (8 years ago)
Author:
Ling-Xiao Yang
Comment:

Hello there,

Do we have a reason to have the both _render() and render() methods? In django.template, _render() is not used anywhere else.

Code reference:

~/django$ grep -r "\._render(" . -A 2 -B 2
./django/forms/widgets.py-        """Render the widget as an HTML string."""
./django/forms/widgets.py-        context = self.get_context(name, value, attrs)
./django/forms/widgets.py:        return self._render(self.template_name, context, renderer)
./django/forms/widgets.py-
./django/forms/widgets.py-    def _render(self, template_name, context, renderer=None):
--
./django/forms/boundfield.py-    def tag(self, wrap_label=False):
./django/forms/boundfield.py-        context = {'widget': self.data, 'wrap_label': wrap_label}
./django/forms/boundfield.py:        return self.parent_widget._render(self.template_name, context, self.renderer)
./django/forms/boundfield.py-
./django/forms/boundfield.py-    @property
--
./django/template/loader_tags.py-        # Call Template._render explicitly so the parser context stays
./django/template/loader_tags.py-        # the same.
./django/template/loader_tags.py:        return compiled_parent._render(context)
./django/template/loader_tags.py-
./django/template/loader_tags.py-
--
./django/template/base.py-                with context.bind_template(self):
./django/template/base.py-                    context.template_name = self.name
./django/template/base.py:                    return self._render(context)
./django/template/base.py-            else:
./django/template/base.py:                return self._render(context)
./django/template/base.py-
./django/template/base.py-    def compile_nodelist(self):

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27956

    • Property Component UncategorizedTemplate system
    • Property Cc ling-xiao.yang@… added
    • Property Version 1.10master
    • Property Triage Stage UnreviewedAccepted
    • Property Summary In DEBUG interface, the section "error during template rendering" doesn't go inside an included templateTemplate error raised in an {% extends %} parent template shows incorrect source location on debug page
  • Ticket #27956 – Description

    initial v5  
     1Please see comment:2 for updated description. Below is the original description.
     2
     3================================================
     4
    15Hello,
    26
Back to Top