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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-07-2013, 03:07 AM   #1
rubberbucket
Junior Member
rubberbucket began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2013
Device: Nook Tablet
Search for empty text box without using "false"

I've created my own column to designate which books I've read. The text type will show a green check mark if I type in "true" for the books I've read, and a red x-mark if I type in "false" for the ones I haven't. I thought it was easiest just to mark the books I've read and leave the others blank. Problem now is that I'm not sure how to create a virtual library for the books I haven't read.
Normally the search expression would be 'read:false' and it would bring up all the books that didn't have anything in the 'read' column, right? But if it's a true/false column, how to I search blank boxes then?? If I put 'read:false' in the search expression I get an error saying it produces no results.
rubberbucket is offline   Reply With Quote
Old 07-07-2013, 03:20 AM   #2
PeterT
Taking a break; Fed up
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: 7,355
Karma: 46281507
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
For custom fields you have to precede the name with a hash symbol #. If you hover over the top of the column a screen-tip should show you the name you have to use.
PeterT is online now   Reply With Quote
Old 07-07-2013, 03:31 AM   #3
eschwartz
Irrational Optimist
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 8,289
Karma: 14758799
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Weird. I've never used true/false columns but the manual says "yes" & "no" are the value type, and "true" & "false" should show the empty ones. Maybe something changed? In any event it says
Quote:
Yes/no custom columns are searchable. Searching for "false", "empty", or "blank" will find all books with undefined values in the column. Searching for "true" will find all books that do not have undefined values in the column. Searching for "yes" or "checked" will find all books with Yes in the column. Searching for no or unchecked will find all books with No in the column. Note that the words "yes", "no", "blank", "empty", "checked" and "unchecked" are translated; you must use the current language’s equivalent word. The words "true" and "false" and the special values "_yes" and "_no" are not translated.
So I would suggest trying "empty" and "blank" but I have no idea if it will work.
eschwartz is offline   Reply With Quote
Old 07-07-2013, 03:51 AM   #4
chaley
"chaley", not "charley"
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: 5,896
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
If this is a text-type custom column then use #colkey:=true and #colkey:=false to avoid having true and false be treated as reserved words with special meaning.

If it is a yes/no column then use #colkey:yes for the green check, #colkey:no for for the red X, and #colkey:empty for not set. As the documentation says (and is the same for all other columns), #colkey:true will find all cells that have any value (set) and #colkey:false will find cells that have no value at all (unset).
chaley is offline   Reply With Quote
Old 07-07-2013, 03:58 AM   #5
rubberbucket
Junior Member
rubberbucket began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2013
Device: Nook Tablet
Holy smokes ... it was the hash tag that did it. Thanks for the tip, PeterT!

And thanks for that clarification, eschwartz. Working on organizing my library and that will help me a lot! A bit new to all this coding or these expressions or whatever you call it, lol.
rubberbucket is offline   Reply With Quote
Old 07-07-2013, 09:03 AM   #6
theducks
Grand Sorcerer
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: 15,244
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
and if you use a Tristate Yes/No/Blank, your logic thinking gets a twist


to find Blank or No: not #colkey:true
theducks is offline   Reply With Quote
Old 07-07-2013, 09:19 AM   #7
chaley
"chaley", not "charley"
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: 5,896
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by theducks View Post
and if you use a Tristate Yes/No/Blank, your logic thinking gets a twist


to find Blank or No: not #colkey:true
I think you mean not tristate. In Tristate (which most yes/no columns are), the above test will give you the same as #colkey:false, or just cells that are not set to anything. #colkey:true is true for both yes and no.

When not using tristate, the "unset" value is effectively forced to 'no' and the meaning of :true and :false change. The test #colkey:true matches only 'yes' and #colkey:false matches everything else.

For those of you who can read code, the exact tests are:
Code:
if not bools_are_tristate:
    if val is None or not val:  # item is None or set to false
        if query in (self.local_no, self.local_unchecked, '_no', 'false'):
            matches.add(item[0])
    else:  # item is explicitly set to true
        if query in (self.local_yes, self.local_checked, '_yes', 'true'):
            matches.add(item[0])
else:
    if val is None:
        if query in (self.local_empty, self.local_blank, '_empty', 'false'):
            matches.add(item[0])
    elif not val:  # is not None and false
        if query in (self.local_no, self.local_unchecked, '_no', 'true'):
            matches.add(item[0])
    else:  # item is not None and true
        if query in (self.local_yes, self.local_checked, '_yes', 'true'):
            matches.add(item[0])
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
Question: addition of "virtual libraries" (was "base search restriction") chaley Library Management 53 04-15-2013 01:52 PM
Jake Lassiter Hits Havana: Bestseller "False Dawn" Now an E-Book Paul Levine Self-Promotions by Authors and Publishers 3 05-20-2011 10:33 PM
Opus "Search in text" feature Heavymachinegun Bookeen 8 10-22-2009 11:52 AM
Question - Does iLiab have the "search" & "annotation, highlighting" features? HiSoC8Y iRex 5 07-01-2009 05:37 PM
"BOOKS" button leads to an empty display after configured to the CF card? genome2k iRex 12 09-24-2008 09:14 AM


All times are GMT -4. The time now is 01:04 AM.


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