Created
May 10, 2010 21:01
-
-
Save johnboxall/396540 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
import django_filters | |
class DateRangeField(django_filters.fields.RangeField): | |
# Django-Filter DateRangeFilter that really accepts a range of dates ;) | |
def __init__(self, *args, **kwargs): | |
fields = ( | |
forms.DateField(), | |
forms.DateField(), | |
) | |
forms.MultiValueField.__init__(self, fields, *args, **kwargs) | |
class DateRangeFilter(django_filters.RangeFilter): | |
field_class = DateRangeField |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi John. This looks like is should be part of Django Filter. Would you be happy to contribute it?