title: How to do proper reverse querying when using Django generic relations?
body: <p>I have implemented django generic relations to create relations between models. My models are,</p>
  
  <pre><code>class CessPoint(BaseModel):
      ....
      title = models.CharField(max_length=100)
  
  class BilledVehicle(BaseModel):
      ....
      source = models.ForeignKey(CessPoint, on_delete=models.CASCADE)
  
  class Bill(BaseModel):
      .....
      content_type = models.ForeignKey(
      ContentType, on_delete=models.CASCADE, null=True)
      object_id = models.UUIDField(null=True)
      billed_item = GenericForeignKey()
  
  class BillPayment(BaseModel):
      .....
      bill = models.ForeignKey(Bill, on_delete=models.CASCADE)        
  </code></pre>
  
  <p>I would like to get the payments for <code>BilledVehicle</code>. This is how I would like to go about it.</p>
  
  <pre><code>BillPayment.objects.filter(bill__content_type=ContentType.objects.get_for_model(BilledVehicle)).values('bill__billed_item__source__title').annotate(total_paid=Sum('amount_paid')).order_by('-total_paid')   
  </code></pre>
  
  <p>I am getting the error:</p>
  
  <pre><code>Field 'billed_item' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
  </code></pre>
  
  <p>According to this answer, <a href="https://stackoverflow.com/questions/36164654/how-to-traverse-a-genericforeignkey-in-django/36166644">How to traverse a GenericForeignKey in Django?</a>, defining a <strong>GenericRelation</strong> might solve my problem. But then again, I did not define a <strong>GenericRelation</strong> because adding one will cascade all relations as per the default behavior</p>
  
  <blockquote>
    <p>Unlike ForeignKey, GenericForeignKey does not accept an on_delete argument to customize this behavior; if desired, you can avoid the cascade-deletion simply by not using GenericRelation, and alternate behavior can be provided via the pre_delete signal.</p>
  </blockquote>