'Decorator that registers a path template function. The
function will be invoked as ``%name{}`` from path format
strings.'

@classmethod
def template_func(cls, name):

    def helper(func):
        if (cls.template_funcs is None):
            cls.template_funcs = {}
        cls.template_funcs[name] = func
        return func
    return helper
