title: Add custom SQL into WHERE clause in Django, without using .raw()
body: <p>I have a complex django ORM query that I'd really rather not have to convert to raw SQL, because it's a very non-trivial query, I want consistency, I use a number of the ORM features to generate the query, and it's been thoroughly tested as it stands.</p>
  
  <p>I want to add a single filter to the WHERE clause on a datetime field. However, I want to test against the <em>date</em> part only, not the time.</p>
  
  <p>Here's a simplified version of my existing query:</p>
  
  <pre><code>MyTable.objects.filter(date_field__gte=datetime.now().date())
  </code></pre>
  
  <p>But I've converted the date_field to datetime_field for more precision in some scenarios. In this scenario, however, I still want a date-only comparison. Something like:</p>
  
  <pre><code>MyTable.objects.filter(datetime_field__datepartonly__gte=datetime.now().date())
  </code></pre>
  
  <p>In postgres, my database of choice, that's simple:</p>
  
  <pre><code>SELECT * FROM mytable WHERE DATE(datetime_field) &gt;= ...
  </code></pre>
  
  <p>How can I do this in django, without converting the entire query to raw SQL?</p>
  
  <ul>
  <li>I tried using F(), but you can only specify field names, not custom SQL.</li>
  <li>I tried using Q(), but same deal.</li>
  <li>I tried Django's SQL functions (Sum, etc), but there are only a few, and it looks like they're designed solely for agreggate queries.
  I tried using an alias, but <a href="https://stackoverflow.com/questions/5333134/django-raw-query-calculated-field-in-where-clause">you can't use aliases in a WHERE clause, either in Django, or in SQL</a></li>
  </ul>
  
  <p><strong>How can I do this in django, without converting the entire query to raw SQL?</strong></p>