MCPcopy
hub / github.com/django/django / add_post_render_callback

Method add_post_render_callback

django/template/response.py:94–103  ·  view source on GitHub ↗

Add a new post-rendering callback. If the response has already been rendered, invoke the callback immediately.

(self, callback)

Source from the content-addressed store, hash-verified

92 return template.render(context, self._request)
93
94 def add_post_render_callback(self, callback):
95 """Add a new post-rendering callback.
96
97 If the response has already been rendered,
98 invoke the callback immediately.
99 """
100 if self._is_rendered:
101 callback(self)
102 else:
103 self._post_render_callbacks.append(callback)
104
105 def render(self):
106 """Render (thereby finalizing) the content of the response.

Callers 3

test_post_callbacksMethod · 0.95
_post_process_requestFunction · 0.80
process_responseMethod · 0.80

Calls 2

callbackFunction · 0.85
appendMethod · 0.45

Tested by 1

test_post_callbacksMethod · 0.76