silentsokolov / django-admin-rangefilter

A Django app that lets you filter data by date range and numeric range in the admin UI
MIT License
721 stars 106 forks source link

Support some quick preset date ranges #1

Closed andybak closed 5 years ago

andybak commented 8 years ago

Really pleased to find this as I was considering writing something similar.

It's great for 'power users' but misses some of the simplicity of the standard date filter. I wonder if the addition of some presets would give the best of both worlds? i.e. 'today', 'this week' etc.

I might work on it myself if I get time and I'll plan for a PR instead of a custom fork if you think it would be a useful addition.

silentsokolov commented 8 years ago

A good idea. Need to think how to implement it. Backward compatibility with AdminDateWidget imposes restrictions ...

imbolc commented 7 years ago

Hey, guys, is here any news?

silentsokolov commented 7 years ago

No

macolo commented 6 years ago

Something like combining this module with the DateTimeFilter kinda works:

    list_filter = (
        ('date', DateTimeFilter),
        ('date', DateRangeFilter),

image

however the url parameters get mingled, for example like this: http://127.0.0.1:8000/admin/work/workentry/?date__lt=2018-07-03&date__gte=2018-05-01&date__lte=2018-05-02

Is there an easy way to prevent this from happening?

silentsokolov commented 5 years ago

After version 0.4.0, your might use list_filter = ('date', DateFieldListFilter), ('date', DateRangeFilter)