|
|
@ -179,6 +179,7 @@ def url_for(endpoint, **values): |
|
|
|
|
|
|
|
|
|
|
|
:param endpoint: the endpoint of the URL (name of the function) |
|
|
|
:param endpoint: the endpoint of the URL (name of the function) |
|
|
|
:param values: the variable arguments of the URL rule |
|
|
|
:param values: the variable arguments of the URL rule |
|
|
|
|
|
|
|
:param _external: if set to `True`, an absolute URL is generated. |
|
|
|
""" |
|
|
|
""" |
|
|
|
ctx = _request_ctx_stack.top |
|
|
|
ctx = _request_ctx_stack.top |
|
|
|
if '.' not in endpoint: |
|
|
|
if '.' not in endpoint: |
|
|
@ -187,7 +188,8 @@ def url_for(endpoint, **values): |
|
|
|
endpoint = mod + '.' + endpoint |
|
|
|
endpoint = mod + '.' + endpoint |
|
|
|
elif endpoint.startswith('.'): |
|
|
|
elif endpoint.startswith('.'): |
|
|
|
endpoint = endpoint[1:] |
|
|
|
endpoint = endpoint[1:] |
|
|
|
return ctx.url_adapter.build(endpoint, values) |
|
|
|
external = values.pop('_external', False) |
|
|
|
|
|
|
|
return ctx.url_adapter.build(endpoint, values, force_external=external) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_template_attribute(template_name, attribute): |
|
|
|
def get_template_attribute(template_name, attribute): |
|
|
|