07-07-2013, 02:07 AM | #1 |
Junior Member
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. |
07-07-2013, 02:20 AM | #2 |
Grand Sorcerer
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.
|
07-07-2013, 02:31 AM | #3 | |
Ex-Helpdesk Junkie
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:
|
|
07-07-2013, 02:51 AM | #4 |
Grand Sorcerer
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). |
07-07-2013, 02:58 AM | #5 |
Junior Member
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. |
07-07-2013, 08:03 AM | #6 |
Well trained by Cats
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 |
07-07-2013, 08:19 AM | #7 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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]) |
|
|
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 |