Quote:
Originally Posted by ownedbycats
What's the best way to find items in a custom column that end with a period? I have a template that can produce these if I forgot to fill out another column first.
|
Is it a tags-like column? If so, this search template will be the fastest way. Set 'field' to your column lookup key. This will work for non-tags-like, but in that case it won't be much faster than a GPM template.
Code:
python:
def evaluate(book, context):
field = '#genre'
items = book.get(field, [])
if not isinstance(items, (list, tuple, set)):
items = (items, )
for t in items:
if t.endswith('.'):
return '1'
return ''