Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2019, 07:32 PM   #1
BruDeV
Junior Member
BruDeV began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2019
Location: southern California
Device: Kindle Fire, Android tablet, PC
Example please: assign(id, val)

"assign(id, val) -- assigns val to id, then returns val. id must be an identifier, not an expression"

I can't seem to get this to work.
What I'd like to do is assign the data from a column-build-from-other-columns to a text or long-text column.

Basically I want to automatically save some data BEFORE making any changes.

IE: assign(#pre_edit_save, field('#build_pre_edit_save'))

#pre_edit_save being a long text column
#build_pre_edit_save being a column built from other columns

<!--build_pre_edit_save ([bulk edit metadata search & replace] build_pre_edit_save -> pre_edit_save)-->
<div style="font-size: medium; background-color: White; ">
<span style="color: Red; ">{authors}: </span>
<span style="color: Green; ">{#save_title}</span>
<div style="color: Black; ">{#title_extras}{series}{series_index:|: |}</div>
</div>
BruDeV is offline   Reply With Quote
Old 11-20-2019, 08:28 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 10,669
Karma: 61100273
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
I believe that id is just a variable name; not a column name. Think of it as the equivalent of an assignment statement (id = value) and that the function in turn returns value.

Sent from my SM-T290 using Tapatalk
PeterT is offline   Reply With Quote
Old 11-20-2019, 08:39 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 24,197
Karma: 27941849
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT, Galaxy Tab A, Kobo Aura2
{ID} is a column that belongs to the Library and is Read Only otherwise, you would break lots of things).

ID is also the same number that is part of the Title folder (if you peeked beneath the skirts ). That IS the linkage in the DB (and also breaks any tie when duplicate names get loaded)
theducks is offline   Reply With Quote
Old 11-21-2019, 08:15 AM   #4
chaley
Grumpy old git
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: 9,030
Karma: 2737842
Join Date: Jan 2010
Location: UK
Device: Many android devices
If you are referring to the calibre template language, you can't do what you are asking. A template cannot modify book metadata. All variables are local, meaning they disappear when the template finishes.

The audit log plugin might give you what you want.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you assign books to TWO or more series? haertig Calibre 10 01-15-2018 10:42 PM
how to assign an ID to every image sbin Sigil 10 12-19-2015 07:00 AM
Assign KB shortcuts phossler Editor 3 08-24-2014 10:42 AM
Hi my name is Val phoenix49 Introduce Yourself 3 01-20-2012 01:07 AM
How do you assign categories?? mrsp Fictionwise eBookwise 5 12-20-2007 01:20 PM


All times are GMT -4. The time now is 05:03 PM.


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