Python django.contrib.auth.mixins 模块,PermissionRequiredMixin() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.contrib.auth.mixins.PermissionRequiredMixin()

项目:django-learning    作者:adoggie    | 项目源码 | 文件源码
def my_view(request):


#PermissionRequiredMixin

    from django.contrib.auth.mixins import PermissionRequiredMixin

    class MyView(PermissionRequiredMixin, View):
        permission_required = 'polls.can_vote'
        # Or multiple of permissions:
        permission_required = ('polls.can_open', 'polls.can_edit')

#AccessMixin