title: How to compare dates in sqlalchemy?
body: <p>I have the following simple setup, where fromDate and toDate are strings on the format "YYYY-MM-DD":</p>
  
  <pre><code>class SomeType(Base):
      date = Column(DateTime)
  
  def findAll(fromDate, toDate):
      return session.query(SomeType).filter(SomeType.date &gt;= fromDate, SomeType.date &lt;= toDate).all()
  </code></pre>
  
  <p>The problem is that it doesn't find what I want it to find unless I modify the input dates like this:</p>
  
  <pre><code>def findAll(fromDate, toDate):
      fromDate = fromDate + " 00:00"
      toDate = toDate + " 24:00"
      return session.query(SomeType).filter(SomeType.date &gt;= fromDate, SomeType.date &lt;= toDate).all()
  </code></pre>
  
  <p>But that doesn't look good. Any ideas on how I can do this the right way?</p>