引用xadmin 的fieldSet 对不想显示的字段添加**{"style":"display:None"}
from xadmin.layout import Fieldset
class ProductCategoryAdmin(object):
list_display = ['pc_name',,'pc_icorn','pc_link','sort','pc_parent']
form_layout = (
Fieldset(None,
'pc_name','pc_icorn','pc_link','sort'
),
Fieldset(None,
'pc_id','pc_parent',**{"style":"display:None"} #隐藏前面两个字段
),
)
xadmin.site.register(ProductCategory,ProductCategoryAdmin)