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
749 B
25 lines
749 B
from django.shortcuts import render
|
|
from django.contrib.auth.models import Group
|
|
from django.views.generic import ListView, DetailView
|
|
from .models import User
|
|
|
|
|
|
class UserListView(ListView):
|
|
model = User
|
|
template_name = 'users/users_list.html'
|
|
context_object_name = 'users'
|
|
|
|
|
|
class UserInfoListView(ListView):
|
|
model = User
|
|
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'] = User.perform_objects.all()
|
|
context['customers'] = User.customers_objects.all()
|
|
return context
|
|
|
|
class UserDetailView(DetailView):
|
|
model = User
|
|
|