diff options
| author | Keryn Knight <keryn@kerynknight.com> | 2021-06-07 20:02:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-07 21:02:00 +0200 |
| commit | 7f6a41d3d915feb01acfa08b2b936d1199db3ba6 (patch) | |
| tree | 35b4e15ba29024d708e70607b21083b4942ad3b4 /django/template/base.py | |
| parent | bbf09254a3919821a9fa5f4e770b234829b64dee (diff) | |
Fixed #32814 -- Improved performance of TextNode.
This avoids calling render() and handling exceptions, which is not
necessary for text nodes.
Diffstat (limited to 'django/template/base.py')
| -rw-r--r-- | django/template/base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/template/base.py b/django/template/base.py index ed1bae3022..1446cc865e 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -981,6 +981,15 @@ class TextNode(Node): def render(self, context): return self.s + def render_annotated(self, context): + """ + Return the given value. + + The default implementation of this method handles exceptions raised + during rendering, which is not necessary for text nodes. + """ + return self.s + def render_value_in_context(value, context): """ |
