Skip to content

Commit

Permalink
Update fields.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Thutmose3 authored May 14, 2024
1 parent 2de86b1 commit 7385bba
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions django_filters/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ def compress(self, data_list):


class DateRangeField(RangeField):
"""A DateRangeField."""

widget = DateRangeWidget

def __init__(self, *args, **kwargs):
"""Initialize the DateRangeField."""
fields = (forms.DateField(), forms.DateField())
super().__init__(fields, *args, **kwargs)

def compress(self, data_list):
"""Compress the data_list."""
if data_list:
start_date, stop_date = data_list
return slice(start_date, stop_date)
Expand Down

0 comments on commit 7385bba

Please sign in to comment.