Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2022, 09:08 AM   #1
igorius
Zealot
igorius began at the beginning.
 
Posts: 123
Karma: 34
Join Date: Jun 2015
Device: ipad & inkpad X
setting custom column problem

I have a strange problem with setting a custom column:
First problem: The program i used to set the reading status to 100 when #read gets set stopped working. I dont know why...

program: if test(check_yes_no('#read', 0, 0, 1), '#0000ff', '') then assign('#reading', 100) fi;

The template editor shows 100 when the #read is set and nothing when #read is not set or undefined.
But the field doesnt get updated anymore.

Second problem: Is it possible to set directly 2 different columns at the same time like

program: if test(check_yes_no('#read', 0, 0, 1), '#0000ff', '') then assign('#reading', 100) && assign ('#last_read', today()) fi;

Can i use the today() this way?

#read is yes/no
#reading is float
#last_read is date
igorius is offline   Reply With Quote
Old 08-28-2022, 10:06 AM   #2
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by igorius View Post
I have a strange problem with setting a custom column:
First problem: The program i used to set the reading status to 100 when #read gets set stopped working. I dont know why...

program: if test(check_yes_no('#read', 0, 0, 1), '#0000ff', '') then assign('#reading', 100) fi;

The template editor shows 100 when the #read is set and nothing when #read is not set or undefined.
But the field doesnt get updated anymore.

Second problem: Is it possible to set directly 2 different columns at the same time like

program: if test(check_yes_no('#read', 0, 0, 1), '#0000ff', '') then assign('#reading', 100) && assign ('#last_read', today()) fi;

Can i use the today() this way?

#read is yes/no
#reading is float
#last_read is date
Assuming I understand your question...

Your problem: assign() doesn't do what you think it does. It sets a local variable in a template. It does not set the value of a column. Nothing in the template language has ever changed values in columns.

You can do what you want with the Action Chains plugin, which can set columns to the result of a template.

If you are asking about a composite column (column made from other columns) then a) don't use assign, and b) you can't compute the value of two columns with one template.
chaley is offline   Reply With Quote
Advert
Old 08-28-2022, 12:50 PM   #3
igorius
Zealot
igorius began at the beginning.
 
Posts: 123
Karma: 34
Join Date: Jun 2015
Device: ipad & inkpad X
Ah, ok. But the first program worked before, so the question is, why!
The documentation is somewhat ... strange.

Ok, tested action chains, but i dont understand what to do to get such simple thing set...
A kind of step by step would help.
igorius is offline   Reply With Quote
Old 08-28-2022, 01:11 PM   #4
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by igorius View Post
Ah, ok. But the first program worked before, so the question is, why!
No clue. I can say is that assign() in the template language has *never* set values of columns.
Quote:
Ok, tested action chains, but i dont understand what to do to get such simple thing set...
A kind of step by step would help.
Ask in the Action Chains plugin thread. They will want to know what triggers changing the value in the column.

I confess that I don't understand what you are trying to do and when to do it. In the calibre GUI, templates for composite columns are executed when that column/row is displayed. Are you intending to display something in a composite column?

I also don't understand what you intend the program to do. The test return what appears to be a color, but then throws that away with the "then" clause. What is the point of the test?

Perhaps the best way forward is for you to tell us what you are trying to do.
chaley is offline   Reply With Quote
Old 08-29-2022, 02:08 PM   #5
igorius
Zealot
igorius began at the beginning.
 
Posts: 123
Karma: 34
Join Date: Jun 2015
Device: ipad & inkpad X
Ok, the program is the result of creating a rule in "coloring column", which i converted to "advanced rule". Due to the (in my opinion) not existing or extremely bad documentation - this was the first entry to get something changed: here the coloring columns.
So the whole syntax of the programming language and therefore the "what can i achieve" is a mystery for me.
In the end i was searching, reading, trying whatever -> mostly without any success.
So for example in no place i can find that i cannot change values in columns.

The resulting color which is a rest of "what do i have to do/enter there" - No clue how that thing works.

What i want to do:
When my Pocketbook gets synced with calibre, in calibre the #read gets set when on my PB the book is finished reading. Maybe the #reading (progress) gets some day programmed in the plugin. Meanwhile i want to set the #reading to 100 when the #read gets set from the plugin. At the same time when the #read gets set i want to set the #last_read to the actual date.
I hope i can tell what i want (my english is not the best)
I was looking to create a plugin, but the documentation for programming plugins is the same mess. And whatever plugin i was looking in - nothing is documented. So i dont understand what the people did - and when a plugin gets abandonned, no one is able to repair that thing, except by old bears who run since years with the development team, but little babies like me are lost, which makes the whole thing a headcrasher...

So finally its funny that you dont understand me, i dont understand what you mean with "Are you intending to display something in a composite column?" What is a composite column? "take a and b and put it together in a field of a column? Like its done by coloring? Say pdf gets colored red, epub blue? Or is it like the isbn-column: Only isbn is shown, even when i have bib-number, asin or whatever is set in the metadata-field? In this case the metadata-field is not changed, right. But i want a change in a metadata-field like if #read is set (test(yes/no), then #reading := 100 and #last_read := actual date.

I apreciate much that you try to help me, thank you very much!!!
igorius is offline   Reply With Quote
Advert
Old 08-29-2022, 04:05 PM   #6
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by igorius View Post
What i want to do:
When my Pocketbook gets synced with calibre, in calibre the #read gets set when on my PB the book is finished reading. Maybe the #reading (progress) gets some day programmed in the plugin. Meanwhile i want to set the #reading to 100 when the #read gets set from the plugin. At the same time when the #read gets set i want to set the #last_read to the actual date.
I hope i can tell what i want (my english is not the best)
To repeat back what I think you said: what you want is that when the #read column is set to some value in calibre, including by a plugin, do:
  • If it is true then set #reading to 100. What happens if it is set to empty or false?
  • Set #last_read to the actual date.
I think action chains can do this. Ask for help in that plugin's thread.
Quote:
So finally its funny that you dont understand me, i dont understand what you mean with "Are you intending to display something in a composite column?" What is a composite column?
I defined "composite column" in post #2: a "column built from other columns".

FWIW: I suggest you leave out the complaints when you ask for help. Many if not most of the people on this forum who provide help are "old bears" who volunteer: writing plugins, contributing documentation and code to calibre, and helping on this forum because they enjoy it. You saying that what we have done is "extremely bad" etc doesn't encourage us to spend time with you.
chaley is offline   Reply With Quote
Old 09-02-2022, 02:50 PM   #7
igorius
Zealot
igorius began at the beginning.
 
Posts: 123
Karma: 34
Join Date: Jun 2015
Device: ipad & inkpad X
Yes, you are right, that was not so funny from my side, but i spent several days searching and reading the manual/help/forum and it was/is so frustrating to have not even 1 positive result...
That i cannot change fields in columns is nowhere documented...
Thats what i mean with bad documentation.
I remember the first days of iphone jailbreaking: First time it took 19 hours to get that job done because every documentation for doing that job was missing crucial steps... Its feeling a bit like that days.
So i am really sorry for having offended any person here, that was definitely not my intention: The whole work and what i get with calibre is one of the best things of software i have seen! Only documentation is somewhat ... thin.
So again: I am sorry for having offended!
And thank you again very much for your help! So i give up that idea and will wait for better days.
igorius is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Column for Automatically Setting Status? TheArtfulDodger Calibre 6 04-27-2020 03:00 PM
Mass Select for Custom Column setting ab257 Library Management 2 10-15-2014 02:08 PM
Custom column problem Statch Calibre 6 06-14-2013 02:03 PM
Setting a default value for a custom column? rangepig Calibre 2 10-11-2010 01:28 PM
Custom Column Problem MSJim Calibre 7 09-08-2010 05:07 PM


All times are GMT -4. The time now is 05:13 AM.


MobileRead.com is a privately owned, operated and funded community.