'Decorator that registers a path template field computation.
The value will be referenced as ``$name`` from path format
strings. The function must accept a single parameter, the Item
being formatted.'

@classmethod
def template_field(cls, name):

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