title: SQLAlchemy: unexpected results when using `and` and `or`
body: <p>I have a declarative base class <code>News</code>:</p>
  
  <pre><code>class News(Base):
      __tablename__ = "news"
      id = Column(Integer, primary_key = True)
      title = Column(String)
      author = Column(String)
      url = Column(String)
      comments = Column(Integer)
      points = Column(Integer)
      label = Column(String)
  </code></pre>
  
  <p>I also have a function <code>f(title)</code>, that gets a string and returns one of 3 variants of strings: 'good', 'maybe' or 'never'. 
  I try to get filtered rows:</p>
  
  <pre><code>rows = s.query(News).filter(News.label == None and f(News.title) == 'good').all()
  </code></pre>
  
  <p>But the program fails, raising this error:</p>
  
  <pre><code>raise TypeError("Boolean value of this clause is not defined")
  </code></pre>
  
  <p>How can I resolve it? </p>