users.py 590 Bytes
Newer Older
1
from django.contrib.auth.models import User
2
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
3 4 5

from django.views.generic.list import ListView

6
class UserListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
7
    model = User
8
    paginate_by = 20
9 10
    template_name = 'user/user_list.html'
    permission_required = 'userprofile.can_edit_users'
11 12

    def get_queryset(self):
13 14 15
        qs = super().get_queryset()

        return qs
16 17 18 19 20

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)

        return context