def check_grafik(req,file,shab):
wb = open_wb(file)
sheet_wb = wb['График']
shablon = load_workbook(shab)
sheet_shablon = shablon['График']
name_file = give_name_file(file)
row_count = sheet_shablon.max_row
a = find_index(a='I', sheet = sheet_shablon, count=row_count) - 2
b = find_index(a='IV', sheet = sheet_shablon, count=row_count) + 6
list = give_list(2, 54, sheet = sheet_shablon, sheet2=sheet_wb, m=a, n=b)
wb.save('media/' + 'media/' + name_file + '.xlsx')
wb.close()
return locals()
if 'grafik' in req.POST:
file = Files.objects.get(file_id=file_id)
check_grafik(req, file,shab=req.FILES['shablon'])