Decorator

def template(filename):
    """
    Decorator
    """
    def method_wrapper(method):

        @wraps(method)
        def jinja_wrapper(*args, **kwargs):
            ret = method(*args, **kwargs)
            return render_template(filename, ret)

        return jinja_wrapper

    return method_wrapper