且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

添加 list_filter 时,如何在 django modeladmin 更改列表中修复/设置列宽?

更新时间:2023-09-26 19:47:28

你可能想参考这个:https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-模板

基本上,change_list.html 需要被覆盖.

basically, the change_list.html needs to be overridden .

你可以这样做:

templates/
  admin/
    app/
      change_list.html

您可以从 django/contrib/admin/templates/admin/

并按照您想要的方式更新 css.

and update the css the way you desire.