You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
784 B
25 lines
784 B
from django.shortcuts import render
|
|
from django.contrib.auth.models import Group
|
|
from django.views.generic import ListView, DetailView
|
|
from .models import CustomUser
|
|
|
|
|
|
class UserListView(ListView):
|
|
model = CustomUser
|
|
template_name = 'users/users_list.html'
|
|
context_object_name = 'users'
|
|
|
|
|
|
class UserInfoListView(ListView):
|
|
model = CustomUser
|
|
template_name = 'users/users_info_list.html'
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super(UserInfoListView, self).get_context_data(**kwargs)
|
|
context['groups'] = Group.objects.all()
|
|
context['performers'] = CustomUser.perform_objects.all()
|
|
context['customers'] = CustomUser.customers_objects.all()
|
|
return context
|
|
|
|
class UserDetailView(DetailView):
|
|
model = CustomUser |