How to fix/set column width in a django modeladmin change list table when a list_filter is added?

前端 未结 2 480
忘了有多久
忘了有多久 2020-12-16 21:34

I\'m working on improving the admin.py in a django project, and while I\'m not totally jazzed about how the table was coming out with three fields in the list_diplay, at lea

2条回答
  •  温柔的废话
    2020-12-16 22:17

    You may want to refer to this: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template

    basically, the change_list.html needs to be overridden .

    you can do it this way:

    templates/
      admin/
        app/
          change_list.html
    

    you can obtain a copy of change_list.html from django/contrib/admin/templates/admin/

    and update the css the way you desire.

提交回复
热议问题