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 07-07-2013, 02: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, 02:20 AM   #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: 12,166
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
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 offline   Reply With Quote
Old 07-07-2013, 02:31 AM   #3
eschwartz
Ex-Helpdesk Junkie
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: 19,422
Karma: 85397180
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, 02:51 AM   #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: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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, 02: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, 08:03 AM   #6
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: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
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, 08:19 AM   #7
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: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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


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 12: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 09:33 PM
Opus "Search in text" feature Heavymachinegun Bookeen 8 10-22-2009 10:52 AM
Question - Does iLiab have the "search" & "annotation, highlighting" features? HiSoC8Y iRex 5 07-01-2009 04:37 PM
"BOOKS" button leads to an empty display after configured to the CF card? genome2k iRex 12 09-24-2008 08:14 AM


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


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