This is a report page I create which is fetching and calculating all the records.

I will like to filter by date just like how I create the form above the cards.

How can I do that?

this is my view

```
def report(request):
pos = Order.objects.all().aggregate(Sum('pos'))
pos_sum = pos['pos__sum']
transfer = Order.objects.aggregate(Sum('transfer'))
transfer_sum = transfer['transfer__sum']
cash = Order.objects.aggregate(Sum('cash'))
cash_sum = cash['cash__sum']
total = pos_sum + transfer_sum + cash_sum
# payments report
paid = Order.objects.filter(paid=True).count()
unpaid = Order.objects.filter(paid=False).count()
oncredit = Order.objects.filter(on_credit = True).count()
total_payment = paid + unpaid + oncredit
context = {
'pos_sum':pos_sum,
'transfer_sum':transfer_sum,
'cash_sum':cash_sum,
'total':total,
'paid':paid,
'unpaid':unpaid,
'oncredit':oncredit,
'total_payment':total_payment,
}
return render(request, 'customers/report_template.html', context=context)
```

Thanks