title: Getting the query from a django Q() object
body: <p>I have a Django queryset where I have to use the <code>.extra(select=)</code> method, since I'm calculating a field that requires a <code>WHERE</code> statement subfilter.</p>
  
  <p>I use this <code>WHERE</code> clause in a number of places, and I'd like to be obeying DRY (which is usually somewhat difficult when writing raw SQL).  I have written a statement using Django's <code>Q()</code> objects that I could reuse and add into the raw SQL.</p>
  
  <p>I know that you can do <code>Queryset.query.__str__()</code> to get the equivalent SQL output--is there a way to do this with <code>Q</code> objects?</p>