How to set start and end date in django_filter's DateFromToRangeFilter?

I want to add conditions in my start date, like start date have to be <= today and end date > today

class PartLogFilter(django_filters.FilterSet):
    date_range = django_filters.DateFromToRangeFilter(
        label='By Date Range',
        widget=RangeWidget(attrs={'class': 'datepicker', 'type': 'date'})
    class Meta:
        model = PartLog
        fields = ['date_range']
    def filter_by_range(self, queryset, name, value):
        start = value.start
        end = value.stop
        return queryset.filter(transaction_time__gte=start, transaction_time__lte=end)
1 Like