silentsokolov/django-admin-rangefilter

Adding blocks to the template / customizing filter name

RamezIssac opened this issue · 2 comments

Hello !! Thank yo for this nice app !!

I faced an issue not being able to customize the range filter name,,, it takes a field verbose name but sometimes that's not clear enough.
And the date_filter template does not provide any blocks to extend it..

In the next release ...

@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
    list_filter = (
        ('created_at', DateRangeFilter),
    )

    # If you would like to change a title range filter
    def get_rangefilter_created_at_title(self, request, field_path):
        return 'custom title'

Brilliant ! Thanks.