title: Django Filter specific user's salary within giving date range
body: <p>I have Two models :</p>
  <pre><code>class MonthSalary(models.Model):
      month = models.DateField(null=True)
  
      def __str__(self):
          return str(self.month.year) + '/' + str(self.month.month)
  
  class SalaryPerMonth(models.Model):
      user = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
      salary_month = models.ForeignKey(MonthSalary, null=True, on_delete=models.CASCADE)
      main_salary_per_month = models.PositiveIntegerField(default=0, null=True)
      net_salary_per_month = models.PositiveIntegerField(default=0, null=True)
  
      class Meta:
          constraints = [
              models.UniqueConstraint(fields=[&quot;user&quot;, &quot;salary_month&quot;], name=&quot;all_keys_unique_together&quot;)]
  
      def __str__(self):
          return str(self.user.employeedetail.empcode) + ' ' + str(self.net_salary_per_month) + ' USD' + str(
              self.salary_month)
  </code></pre>
  <p>In Views I can query all user salaries with :</p>
  <pre><code>user = request.user
  salary_per_month = SalaryPerMonth.objects.filter(user=user)
  </code></pre>
  <p>In MonthSalary model I added a bunch of months\years not in order Ex &quot;2022-2,2022-4,2022-1,2021-4&quot; when I filter user's salary by ordering the date &quot;related salary_month field&quot; like so :</p>
  <pre><code>salary_per_month = SalaryPerMonth.objects.filter(user=user).order_by('salary_month')
  </code></pre>
  <p>It's not in order.</p>
  <p>Q1 = How how filter by Year ?
  Q2 = How to order by month ?</p>