View Single Post
Old 03-02-2011, 05:00 AM   #6
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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?

EDIT: I suppose this would improve things:
Code:
name:Identifier
def evaluate(self, formatter, kwargs, mi, locals, val):
    return mi.get_identifiers().get(val,'')
and then in my custom column I do this:
program: Identifier('isbn')

Last edited by kiwidude; 03-02-2011 at 05:08 AM.
kiwidude is offline   Reply With Quote