title: How to show form this query in django
body: <p>I have two django models:</p>
  
  <pre><code>class RegistrationDetail(models.Model):
  
      registration_number = models.CharField(
          _("Registration Number"),
          max_length=32,
          unique=True,
          db_index=True)
  
      policies = models.ManyToManyField('Policy', blank=True)
  
  
  class Policy(Models.model):
     policy_id = UUIDField(unique=True)    
     issue_date = models.DateTimeField(null=True)
     start_date = models.DateField()
     expiry_date = models.DateField()
  </code></pre>
  
  <p>I have to form a query which finds out all the policies attached to respective registration numbers and then compares if the start dates of the corresponding policies of a particular registration number have a difference of 300 days or not. How do i proceed with this query ?</p>