Reputation: 1318
Is there a way to print out Django Admin
's change_list page without including the filers? For example, if the page at 0.0.0.0:8000/admin/<app>/<object>/
shows the following
I want to create a button that, when clicked, prints only this.
I realize that I could just remove list_filter
but for some pages, I need them to be there
Upvotes: 1
Views: 614
Reputation: 20569
You can overwrite get_list_filter
method in your ModelAdmin
subclass and define logic here that can disable filters just by returning empty list or tuple. For example:
class MyModelAdmin(admin.ModelAdmin):
list_filter = ['class']
def get_list_filter(self, request):
if request.GET.get('no_filters') == '1':
return []
return super(MyModelAdmin, self).get_list_filter(request)
Upvotes: 1