Начало скачивание файла
This commit is contained in:
1 parent
470fc3d686
commit
5666c46de8
3 files changed
+15
-4
No files matched your search
BIN
Binary file not shown.
@@ -14,6 +14,8 @@ import openpyxl as oxl
|
||||
from openpyxl import Workbook
|
||||
from openpyxl.styles import Font, Alignment, Side, Border, PatternFill
|
||||
from openpyxl.worksheet.formula import ArrayFormula
|
||||
from pandas.api.types import CategoricalDtype
|
||||
import urllib.request
|
||||
|
||||
class GeneralVacationAPIView(APIView):
|
||||
def get(self, request):
|
||||
@@ -40,6 +42,8 @@ class DailyRoundUpAPIView(APIView):
|
||||
"""
|
||||
PIXELS_PER_CHAR = 7
|
||||
return (width) / PIXELS_PER_CHAR
|
||||
|
||||
|
||||
|
||||
def get(self, request):
|
||||
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
|
||||
@@ -115,8 +119,12 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
|
||||
k=7
|
||||
for i in df['department'].unique():
|
||||
|
||||
|
||||
for i in sorted(df['department'].unique(), reverse=True):
|
||||
|
||||
ws.cell(row = k, column = 2).value = i
|
||||
|
||||
ws.cell(row = k, column = 2).font = Font(name='Times New Roman', size=10, bold=True)
|
||||
ws.merge_cells(start_row=k, start_column=2, end_row=k, end_column=12)
|
||||
|
||||
@@ -182,15 +190,18 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
ws.cell(row = k+3, column=7).value = "факт работающих"
|
||||
ws.cell(row = k+3, column=7).font = Font(name='Times New Roman', size=14, bold=True)
|
||||
# +"-J"+str(k-1)+"-L"+str(k-1)+"
|
||||
ws.cell(row = k+3, column=8).value = "=F"+str(k+1)+"-H"+str(k+1)+"-J"+str(k+1)
|
||||
|
||||
|
||||
ws.cell(row = k+3, column=8).value = f"=F{k+1}-H{k+1}-J{k+1}-L{k+1}"
|
||||
ws.cell(row = k+3, column=8).font = Font(name='Times New Roman', size=14, bold=True)
|
||||
|
||||
print(ws.cell(row = k, column=6), '-------------------1')
|
||||
# print(ws.write(k+3, col, 'hhh'), '-------------------1')
|
||||
|
||||
|
||||
wb.save(file_path)
|
||||
|
||||
urllib.request.urlretrieve(file_path, 'Пупка.xlsx')
|
||||
|
||||
# file_path = 'media/DailyRoundUp.xlsx'
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user