【Django3.0功能开发】apps篇:adminx编辑页面指定字段的隐藏的通用方法

文章目录

内容介绍

adminx后台编辑页面中我们希望某些页面指定某些字段隐藏不需要编辑的目标。

adminx.py

class ArticlesAdmin(object):
	......
    # 隐藏字段
    form_layout = (
        Fieldset(None,
                 'detail_slug', 'link_slug', 'article_publish_date', **{
    
    "style": "display:None"} # 隐藏字段需要在models中
                 ),
    )

猜你喜欢

转载自blog.csdn.net/qq_20288327/article/details/112798737