|
|
|
|
@ -188,8 +188,6 @@ class ContractorFilterView(BaseMixin, View): |
|
|
|
|
|
|
|
|
|
context.update({'last_party_types': last_party_types}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if get_contractors: |
|
|
|
|
contractors = User.contractor_objects.all() |
|
|
|
|
|
|
|
|
|
@ -216,9 +214,7 @@ class ContractorFilterView(BaseMixin, View): |
|
|
|
|
|
|
|
|
|
if constr_type: |
|
|
|
|
contractors = contractors.filter(orders__project__realty__construction_type=constr_type) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if get_teams: |
|
|
|
|
teams = Team.objects.all() |
|
|
|
|
|
|
|
|
|
@ -278,7 +274,6 @@ class ContractorFilterView(BaseMixin, View): |
|
|
|
|
count = coll.count() |
|
|
|
|
display_msg = 'Найдено %s групп' % count if count > 0 else 'Ничего не найдено' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
order_by = form.cleaned_data.get('order_by') |
|
|
|
|
last_order_by = form.cleaned_data.get('last_order_by') |
|
|
|
|
reverse_order = form.cleaned_data.get('reverse_order') |
|
|
|
|
@ -421,9 +416,13 @@ class ContractorOfficeProjectsView(BaseMixin, View): |
|
|
|
|
|
|
|
|
|
private_open_projects = tuple(a.project for a in contractor.contractor_answers.filter(project__state='active', rejected=False)) |
|
|
|
|
private_archived_projects = tuple(a.project for a in contractor.contractor_answers.filter(project__state='active', rejected=True)) |
|
|
|
|
|
|
|
|
|
team_open_projects = tuple(a.project for a in contractor.team.answers.filter(project__state='active', rejected=False)) |
|
|
|
|
team_archived_projects = tuple(a.project for a in contractor.team.answers.filter(project__state='active', rejected=True)) |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
team_open_projects = tuple(a.project for a in contractor.team.answers.filter(project__state='active', rejected=False)) |
|
|
|
|
team_archived_projects = tuple(a.project for a in contractor.team.answers.filter(project__state='active', rejected=True)) |
|
|
|
|
except: |
|
|
|
|
team_open_projects = () |
|
|
|
|
team_archived_projects = () |
|
|
|
|
|
|
|
|
|
context['all_project_count'] = \ |
|
|
|
|
len(private_open_projects) + len(private_archived_projects) + \ |
|
|
|
|
|