Sorry, I didn't explain better. I'm trying to create a custom function that would do a list_sort on lists inside a list.
The code below just gives me:
S/R TEMPLATE ERROR global name 'list_sort' is not defined
Code:
def evaluate(self, formatter, kwargs, mi, locals, val, start_index, end_index, sep):
if not val:
return ''
si = int(start_index)
ei = int(end_index)
# allow empty list items so counts are what the user expects
val = [v.strip() for v in val.split(sep)]
# sort John/Jane to Jane/John
for i, v in enumerate(val):
val[i] = list_sort(v,0,'/')
if sep == ',':
sep = ', '
try:
if ei == 0:
return sep.join(val[si:])
else:
return sep.join(val[si:ei])
except:
return ''