title: SQLAlchemy: avoid query filter if searched value is None
body: <p>Is there a one-liner to handle the following scenario:</p>
  
  <pre><code>def queryByAttr(attr1,attr2=None):
    if attr2 is None:
      session.query(Foo).filter(Foo.attr1==attr1)
    else:
      session.query(Foo).filter(Foo.attr1==attr1).filter(Foo.attr2==attr2)
  </code></pre>