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.

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.

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).

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])