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.
56 lines
1.5 KiB
56 lines
1.5 KiB
from django.shortcuts import render, get_object_or_404
|
|
from django.contrib.auth.models import Group
|
|
from django.views.generic import ListView, DetailView, View, UpdateView
|
|
from django.views.generic.base import TemplateView
|
|
|
|
from archilance.mixins import BaseMixin
|
|
from .models import User
|
|
|
|
|
|
class UserListView(ListView):
|
|
model = User
|
|
template_name = 'users_list.html'
|
|
context_object_name = 'users'
|
|
|
|
|
|
class ContractorListView(ListView):
|
|
model = User
|
|
template_name = 'contractor_list.html'
|
|
|
|
|
|
class ContractorProfileDetailView(DetailView):
|
|
model = User
|
|
template_name = 'contractor_profile.html'
|
|
|
|
|
|
class ContractorOfficeDetailView(DetailView):
|
|
model = User
|
|
template_name = 'contractor_office.html'
|
|
|
|
|
|
class CustomerProfileOpenProjectsView(BaseMixin, DetailView):
|
|
model = User
|
|
template_name = 'customer_profile_open_projects.html'
|
|
|
|
|
|
class CustomerProfileTrashedProjectsView(BaseMixin, DetailView):
|
|
model = User
|
|
template_name = 'customer_profile_trashed_projects.html'
|
|
|
|
|
|
class CustomerProfileCurrentProjectsView(BaseMixin, DetailView):
|
|
model = User
|
|
template_name = 'customer_profile_current_projects.html'
|
|
|
|
|
|
class CustomerProfileReviewsView(BaseMixin, DetailView):
|
|
model = User
|
|
template_name = 'customer_profile_reviews.html'
|
|
|
|
|
|
class ContractorProfileEditView(BaseMixin, View):
|
|
template_name = 'contractor_profile_edit.html'
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
contractor = get_object_or_404(User, pk=kwargs.get('pk'))
|
|
return render(request, self.template_name, {'contractor': contractor})
|
|
|