title: Django RawSql Annotate
body: <p>I'm new to Django so I will have ask some help. I have a table with records representing Transit. When transit arrives to depot, I need to find how many Resources are that time in depot. Resource has start time and end time. What I need to do, is annotate Resources count to Transit using Transit depot arrival time. There is now any relation between models.</p>
  
  <p>I think I might need RawSql for this but I'm still little short of knowledge to do this.</p>
  
  <pre><code>#models.py
  class Transit(models.Model):
      depot_name=models.CharField(max_length=50)
      depot_arrival=models.DateField()
  
  
  class Resource(models.Model):
      resource_id=models.PositiveIntegerField()
      shift_start=models.DateField()
      shift_end=models.DateField()
  
  #views.py
  class TransitView(TableViewMixin)
  
     def get_queryset(self):
         Transit.objects.annotate(
             resources_count=RawSql('Select...')
         )
  </code></pre>