Default filter in Django admin

前端 未结 15 1899
有刺的猬
有刺的猬 2020-11-27 10:49

How can I change the default filter choice from \'ALL\'? I have a field named as status which has three values: activate, pending and

15条回答
  •  暖寄归人
    2020-11-27 10:54

    Note that if instead of pre-selecting a filter value you want to always pre-filter the data before showing it in the admin, you should override the ModelAdmin.queryset() method instead.

提交回复
热议问题