django admin自定义一个权限类的admin

效果

 

 

代码


from django.contrib import admin
from rbac.models import UserInfo, Permission, Role
# Register your models here.


# 自定制一个权限类的admin
class PermissionAdmin(admin.ModelAdmin):
list_display = ['title', 'url']
list_editable = ['url', ]


admin.site.register(UserInfo)
admin.site.register(Permission, PermissionAdmin)
admin.site.register(Role)

 

 

posted @ 2020-05-21 20:07  10132714  阅读(453)  评论(0编辑  收藏  举报