View Single Post
Old 12-06-2024, 06:41 AM   #183
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
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 ''

Last edited by chaley; 12-07-2024 at 08:54 AM.
chaley is offline   Reply With Quote