Quote:
Originally Posted by Tatjana
I don't do this because I am an historian, I do this because I love one, because I can do it, and if i don't do this, I am afraid nobody else will for a very long time.
|
This inspires me to give you a solution. You can use a custom template function in a "column built from other columns".
The steps:
- Create the template function by going to Preferences / Advanced / Template Functions.
- Give the template a name. In this example I named it length_of_longest_author.
- Put a -1 in the Argument count box because the function takes no arguments.
- Put this text in the Program code box:
Code:
def evaluate(self, formatter, kwargs, mi, locals):
authors = mi.get('authors')
if authors:
return max([len(a) for a in authors])
return 0
The following screen capture shows the example

- Create a custom column "built from other columns. Name it whatever you want. Set the template to
Code:
program: length_of_longest_author()
using the name you used for the custom template function. Set the Sort/Search box to "Number". Check the "Show in Tag browser" box if you want to see the values in the tag browser. The following screen capture shows my example.

It will be interesting to see what performance this has on your large library.