如果用户不是 super 管理员,我将如何排除 django admin 中的字段?
谢谢
最佳答案
我是这样做的:
管理文件
def add_view(self, request, form_url='', extra_context=None):
if not request.user.is_superuser:
self.exclude=('activa', )
return super(NoticiaAdmin, self).add_view(request, form_url='', extra_context=None)
关于django - 为非 super 管理员的用户排除 django admin 中的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3464792/