mrts / django-admin-list-filter-dropdown

Use dropdowns in Django admin list filter
MIT License
316 stars 48 forks source link

Add example for Custom filters #12

Closed kunalgrover05 closed 6 years ago

kunalgrover05 commented 6 years ago

Simply adding this template to any existing custom filters would work.

eg:

class CustomFilter(SimpleListFilter):
    title = 'custom'
    parameter_name = 'custom'
    template = 'django_admin_listfilter_dropdown/dropdown_filter.html'

    def lookups(self, request, model_admin):
        # Lookups to be used

    def queryset(self, request, queryset):
        # QS filtering
mrts commented 6 years ago

Great, can you send a pull request (to the docs presumably)?

kunalgrover05 commented 6 years ago

Done https://github.com/mrts/django-admin-list-filter-dropdown/pull/13

mrts commented 6 years ago

Thanks for your help 👍 :)!