Quote:
Originally Posted by kovidgoyal
I hope the illness has passed.
|
Not totally, but my brain has defogged enough where I am doing fewer silly things.
Quote:
I myself, had my leg badly burned with boiling water these past few weeks.
|
Burns are not fun. I hope you are healing without scarring.
As for the proposal: I decided to look at adding a links column to normalized tables in the database. With this I can get rid of the new template function and the calibre://book-details-search link.
If a link for an item is defined then it shows like this example:
There are two links there shown as '(item link)'. The item does what it normally does in calibre. The 'item link' opens whatever the link says.
The API in db.cache is:
Code:
@read_api
def get_links_for_field(self, field, values):
'''
field: the lookup name
values: singleton, list or tuple of field values.
returns dict(field_value:link_value, ...)
'''
@write_api
def set_link_for_field(self, field, value_to_link_map):
'''
field: the lookup name
value_to_link_map: dict(field_value:link, ...)
returns books changed by setting the link
'''
I don't yet have any UI to manage these. I will probably change the category editor used for tags etc, adding a link column to the table.