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

DateRangeQuickSelectListFilter does not show quick select list #118

Closed daphtdazz closed 6 months ago

daphtdazz commented 6 months ago

It just shows the date range picker.

The problem seems to be that DateRangeQuickSelectListFilter overrides get_template() but DateRangeFilter defines:

    def get_template(self):
        ...

    template = property(get_template)

So DateRangeQuickSelectListFilter().template calls DateRangeFilter.get_template() instead of DateRangeQuickSelectListFilter.get_template()

I'm on django 4.2.13 don't know if maybe something changed in django to affect this (maybe it used to use get_template()..?).

If I get a sec I will push a fix but I'm patching it for myself locally like this:

from rangefilter.filters import DateRangeQuickSelectListFilter
DateRangeQuickSelectListFilter.template = property(DateRangeQuickSelectListFilter.get_template)
silentsokolov commented 6 months ago

Fixed, thx!