Skip to content
Myr

URL building should work in theory

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 · parent 5da1fc2 · Browse files · 2 files+15 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

2 files+15 added−0 removed

  • other:+15 added−0 removed

2 files+15 added−0 removed

modified:flask/app.py+14 added
1011 unmodified lines
1012 """1013 return self.url_map.bind_to_environ(request.environ,1014 server_name=self.config['SERVER_NAME'])10151016 def inject_url_defaults(self, endpoint, values):1017 """Injects the URL defaults for the given endpoint directly into1018 the values dictionary passed. This is used internally and1019 automatically called on URL building.10201021 .. versionadded:: 0.71022 """1023 funcs = self.url_default_functions.get(None, ())1024 if '.' in endpoint:1025 bp = endpoint.split('.', 1)[0]1026 funcs = chain(funcs, self.url_default_functions.get(bp, ()))1027 for func in funcs:1028 func(endpoint, values)10291030 def preprocess_request(self):1031 """Called before the actual request dispatching and will1032 call every as :meth:`before_request` decorated function.1033 If any of these function returns a value it's handled as
157 unmodified lines
modified:flask/helpers.py+1 added
178 unmodified lines
179 endpoint = mod + '.' + endpoint180 elif endpoint.startswith('.'):181 endpoint = endpoint[1:]182 external = values.pop('_external', False)183 ctx.app.inject_url_defaults(endpoint, values)184 return ctx.url_adapter.build(endpoint, values, force_external=external)185186187def get_template_attribute(template_name, attribute):
382 unmodified lines