Skip to content
Myr

Added a template filter decorator to blueprints.

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

authored by Reisen · committed by Ron DuPlain · parent 8532bd5 · Browse files · 1 file+11 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+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:flask/blueprints.py+11 added
183 unmodified lines
184 self.record_once(register_endpoint)185 return f186 return decorator187188 def app_template_filter(self, name = None):189 """Like :meth:`Flask.template_filter` but for a blueprint. The filter190 is available for the entire application.191 """192 def decorator(f):193 def register_template(state):194 state.app.jinja_env.filters[name or f.__name__] = f195 self.record_once(register_template)196 return f197 return decorator198199 def before_request(self, f):200 """Like :meth:`Flask.before_request` but for a blueprint. This function201 is only executed before each request that is handled by a function of202 that blueprint.
130 unmodified lines