This repository has been archived on 2022-02-09. You can view files and clone it, but cannot push or open issues or pull requests.
disclosemypay.org/section7/filters.py

17 lines
400 B
Python

from typing import Callable
from typing import Optional
from typing import Tuple
import flask
def url_for(value: str, filename: Optional[str] = None) -> str:
"""Wrapper around :func:`flask.url_for` to expose the functionality in a template"""
if filename:
return flask.url_for(value, filename=filename)
return flask.url_for(value)
FILTERS: Tuple[Callable, ...] = (url_for,)