Mobileread
How can I manage two different columns holding the same data?
#1  Rellwood 05-11-2020, 11:06 PM
I want some help or suggestions on keeping track of, and maintaining two different custom columns with tags shown in the browser. The columns hold the same information but one is hierarchal, and one isn’t.

It’s a book source column. It’s been around almost as long as I have had Calibre. It started with Amazon, Kindle Unlimited, and Library, but it has grown over the years to 50 different tags. I can’t change the tags or the column because it’s in use in tweaks, plugins, and rules. On their own in the book list and when editing the metadata the tags are great. When looking at them in the browser, they suck. Strictly alphabetizing tags isn't a good thing when you use many of them only a few times and the ones you use the most aren't grouped together.

Today I decided to create a new column to hold “Book Source” tags, but in hierarchal form, strictly for use in the tag browser. Hierarchal tags are ugly outside the browser. I don’t want to deal with manually inputting them, or having them high up in my edit metadata custom column order, or booklist view. I plan on hiding the column everywhere but the browser, and hiding the original Book source column in the browser, but showing it everywhere else.

I am asking for help or suggestions on how I can have the original book source field be filled in manually with “Amazon” and have the hierarchal book source column automatically fill in with “0 – Main Sources.Retail.Amazon”, and so on matching up each original tag with a heirarchal. I know I can do a quck copy/replace when starting out, but as the time goes on and new books are brought in, how can I keep it up?

I am afraid that if I manually have to type this field in, it will change because of input error and just forgetting which tag matches with the original one.
Reply 

#2  Terisa de morgan 05-12-2020, 12:00 AM
Not an expert but, for me, the best option would be a composite column, with a program/expression that would copy the original value from the manual one doing the tweaking you need for a hierarchical view.
Reply 

#3  Rellwood 05-21-2020, 01:34 PM
Quote Terisa de morgan
Not an expert but, for me, the best option would be a composite column, with a program/expression that would copy the original value from the manual one doing the tweaking you need for a hierarchical view.
I'm wondering how that would work.

Example - Orignal Column - Amazon
Heirarchal Column - 0 - Main Sources.Retail.Amazon

I wish I could figure out a one - to - one copy because I have other shelves that this would work for, the tags won't change, but keeping up with them sucks, and I wouldn't have so many columns to fill out.

I think what I want is this

If Original column contains Amazon then heirarchal column contains 0 - Main Sources.Retail.Amazon

And so on for each pair.

Is that possible. Create a list of paired tags and have them show up in their colums?
Reply 

#4  Terisa de morgan 05-21-2020, 01:43 PM
Quote Rellwood
I'm wondering how that would work.

Example - Orignal Column - Amazon
Heirarchal Column - 0 - Main Sources.Retail.Amazon

I wish I could figure out a one - to - one copy because I have other shelves that this would work for, the tags won't change, but keeping up with them sucks, and I wouldn't have so many columns to fill out.
I've done it... with a python template function, adapted to the changes I want. I'm sure it can be done in program mode or so on, but I don't handle it quite well.
Reply 

#5  Rellwood 05-21-2020, 01:58 PM
Quote Terisa de morgan
I've done it... with a python template function, adapted to the changes I want. I'm sure it can be done in program mode or so on, but I don't handle it quite well.
What do you mean "You don't handle it quite well"?

If someone out there is willing to accept a donation, I could email a list created from the .db of paired items and they can somehow detail how to create a template for those pairs. Helpful for all those columms. Or at the least, can someone provide me a template that I can use?
Reply 

#6  Terisa de morgan 05-21-2020, 02:04 PM
Quote Rellwood
What do you mean "You don't handle it quite well"?
That I'm not able to create templates but I'm able to program a function, that's what I'm mean.
Reply 

#7  Rellwood 05-21-2020, 02:09 PM
Ah...how is that different?
Reply 

#8  chaley 05-21-2020, 02:22 PM
Quote Terisa de morgan
That I'm not able to create templates but I'm able to program a function, that's what I'm mean.
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
Reply 

#9  Terisa de morgan 05-21-2020, 03:24 PM
Quote chaley
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
Thank you for explaining it much better than me. Yes, I'm more comfortable with programming (around 35 years doing it )
Reply 

#10  Rellwood 05-21-2020, 05:09 PM
Quote chaley
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
I'll DM you, I need to organize the list..THANK YOU!
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register