#NEWLINE# @ classmethod #NEWLINE# def template_field( cls , name ) : #NEWLINE# #INDENT# 'Decorator that registers a path template field computation.\n        The value will be referenced as ``$name`` from path format\n        strings. The function must accept a single parameter, the Item\n        being formatted.\n        ' #NEWLINE# def helper( func ) : #NEWLINE# #INDENT# if ( cls . template_fields is None ) : #NEWLINE# #INDENT# cls . template_fields = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# cls . template_fields [ name ] = func #NEWLINE# return func #NEWLINE# #UNINDENT# return cls