List Filters


Input Text Filters

Idea taken from this medium article.

Baton defines a custom InputFilter class that you can use to create text input filters and use them as any other list_filters, for example

# your app admin

from baton.admin import InputFilter

class IdFilter(InputFilter):
    parameter_name = 'id'
    title = 'id'

    def queryset(self, request, queryset):
        if self.value() is not None:
            search_term = self.value()
            return queryset.filter(

class MyModelAdmin(admin.ModelAdmin):
    list_filters = (

Just define in the queryset method the logic used to retrieve the results.