|
|
|
@ -19,6 +19,7 @@ from .models import User, Team, ContractorFinancialInfo |
|
|
|
from archilance.mixins import BaseMixin |
|
|
|
from archilance.mixins import BaseMixin |
|
|
|
from common.utils import get_or_none |
|
|
|
from common.utils import get_or_none |
|
|
|
from projects.forms import PortfolioForm |
|
|
|
from projects.forms import PortfolioForm |
|
|
|
|
|
|
|
from reviews.models import Review |
|
|
|
from specializations.models import Specialization |
|
|
|
from specializations.models import Specialization |
|
|
|
from work_sell.forms import WorkSellForm |
|
|
|
from work_sell.forms import WorkSellForm |
|
|
|
|
|
|
|
|
|
|
|
@ -224,10 +225,16 @@ class ContractorProfileDetailView(DetailView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
|
|
|
|
|
|
context['worksell_form'] = self.worksell_form_class |
|
|
|
context['worksell_form'] = self.worksell_form_class |
|
|
|
context['portfolio_form'] = self.portfolio_form_class |
|
|
|
context['portfolio_form'] = self.portfolio_form_class |
|
|
|
context['resume_diploms'] = self.object.contractor_resume.resume_files.filter(type='diplom') |
|
|
|
|
|
|
|
context['resume_cro'] = self.object.contractor_resume.resume_files.filter(type='cro') |
|
|
|
resume = self.object.contractor_resume |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if resume: |
|
|
|
|
|
|
|
context['resume_diploms'] = resume.resume_files.filter(type='diplom') |
|
|
|
|
|
|
|
context['resume_cro'] = resume.resume_files.filter(type='cro') |
|
|
|
|
|
|
|
|
|
|
|
return context |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -265,10 +272,23 @@ class CustomerProfileCurrentProjectsView(BaseMixin, DetailView): |
|
|
|
context_object_name = 'customer' |
|
|
|
context_object_name = 'customer' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CustomerProfileReviewsView(BaseMixin, DetailView): |
|
|
|
class CustomerProfileReviewsView(BaseMixin, View): |
|
|
|
model = User |
|
|
|
|
|
|
|
template_name = 'customer_profile_reviews.html' |
|
|
|
template_name = 'customer_profile_reviews.html' |
|
|
|
context_object_name = 'customer' |
|
|
|
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
|
|
|
|
context = self.get_context_data(**_.merge({}, self.request.GET, kwargs)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customer = get_object_or_404(User.customer_objects, pk=self.kwargs['pk']) |
|
|
|
|
|
|
|
reviews = Review.objects.filter(target_customer=customer) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# import code; code.interact(local=dict(globals(), **locals())) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.update({ |
|
|
|
|
|
|
|
'reviews': reviews, |
|
|
|
|
|
|
|
'customer': customer, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return render(request, self.template_name, context) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CustomerProfileEditView(CheckForUserMixin, View): |
|
|
|
class CustomerProfileEditView(CheckForUserMixin, View): |
|
|
|
|