Use the __range
operator:
...filter(current_issue__isnull=True, created_at__range=(start_date, end_date))
__range
two methods
.filter(created_at__range=[from_date, to_date])
another method
.filter(Q(created_at__gte=from_date)&Q(created_at__lte=to_date))
If you are using a DateTimeField
, Filtering with dates won’t include items on the last day.
You need to casts the value as date:
...filter(created_at__date__range=(start_date, end_date))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With