Use explicit check for None instead of trueness

In our legacy database we have a primary key (0) which evaluates False,
but is a legitimate value. That causes the autocompleter to fail with an
exception.
Merge pull request #90 from ekohl/explicit-none-check

Use explicit check for None instead of trueness