Skip to content
Myr

Merge branch 'blueprints' of github.com:mitsuhiko/flask into blueprints

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents 81433ce, 7e6c70a · Browse files · 1 file+20 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−0 removed

  • other:+20 added−0 removed

1 file+20 added−0 removed

modified:flask/blueprints.py+20 added
214 unmodified lines
215 self.record_once(lambda s: s.app.after_request_funcs216 .setdefault(None, []).append(f))217 return f218219 def teardown_request(self, f):220 """Like :meth:`Flask.teardown_request` but for a blueprint. This221 function is only executed when tearing down requests handled by a222 function of that blueprint. Teardown request functions are executed223 when the request context is popped, even when no actual request was224 performed.225 """226 self.record_once(lambda s: s.app.teardown_request_funcs227 .setdefault(self.name, []).append(f))228 return f229230 def teardown_app_request(self, f):231 """Like :meth:`Flask.teardown_request` but for a blueprint. Such a232 function is executed when tearing down each request, even if outside of233 the blueprint.234 """235 self.record_once(lambda s: s.app.teardown_request_funcs236 .setdefault(None, []).append(f))237 return f238239 def context_processor(self, f):240 """Like :meth:`Flask.context_processor` but for a blueprint. This241 function is only executed for requests handled by a blueprint.242 """
69 unmodified lines