This pull request introduces a new TimeRangeFilter to the django-admin-rangefilter library, allowing users to filter records in the Django admin by time range, independent of the date. This feature addresses the need for filtering events or records that occur within a specific time frame across different days.
Implements the TimeRangeFilter class in rangefilter/filters.py, extending the BaseRangeFilter to support time range filtering.
Adds form fields for time input within the TimeRangeFilter, utilizing Django's AdminTimeWidget for user-friendly time selection.
Overrides the queryset method in TimeRangeFilter to filter records based on the specified time range, comparing only the time component of datetime fields.
Updates README.rst to include documentation and an example on how to use the new TimeRangeFilter in Django admin.
Introduces test cases in tests/tests.py to ensure the correct functionality of TimeRangeFilter, including its ability to filter across different days and time zones.
This enhancement broadens the library's utility by enabling more granular time-based filtering, catering to applications that manage time-sensitive data.
This pull request introduces a new
TimeRangeFilter
to thedjango-admin-rangefilter
library, allowing users to filter records in the Django admin by time range, independent of the date. This feature addresses the need for filtering events or records that occur within a specific time frame across different days.TimeRangeFilter
class inrangefilter/filters.py
, extending theBaseRangeFilter
to support time range filtering.TimeRangeFilter
, utilizing Django'sAdminTimeWidget
for user-friendly time selection.queryset
method inTimeRangeFilter
to filter records based on the specified time range, comparing only the time component of datetime fields.README.rst
to include documentation and an example on how to use the newTimeRangeFilter
in Django admin.tests/tests.py
to ensure the correct functionality ofTimeRangeFilter
, including its ability to filter across different days and time zones.This enhancement broadens the library's utility by enabling more granular time-based filtering, catering to applications that manage time-sensitive data.
For more details, open the Copilot Workspace session.