Quote:
Originally Posted by kiwidude
So now you have committed the new identifier stuff, would I be correct in saying that the correct way to display one of the new identifiers in a custom column is to use a program template and do something like:
Code:
name:GoodreadsId
def evaluate(self, formatter, kwargs, mi, locals, val):
return mi.get_identifiers().get('goodreads_id','')
and then in my custom column I do this:
{'':GoodreadsId()}
Or is there a better way?
|
The first thing you must do is add the identifier to the book using db2.set_identifier. Once that is done, then to see the identifier in a custom column, use the new 'select' function, which is a generalized version of what you proposed. Something like {identifiers:select(goodreads_id)}.
To search, use 'identifiers:goodreads_id:what-have-you.' This is a keypair search (something new), searching for key:value pairs. Matching the key and the value are independent, and can use contains, exact, and regexp matching. For example, identifiers:good:true will find all books with a key containing 'good'.