![]() |
#1 |
Zealot
![]() 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 |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() 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. |
![]() |
![]() |
![]() |
#4 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
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. |
||
![]() |
![]() |
![]() |
#5 |
Zealot
![]() 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 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!!! |
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
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. |
||
![]() |
![]() |
![]() |
#7 |
Zealot
![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |