Skip to content

Commit f676ddf

Browse files
committed
Continued conversion to f-strings from .format for speed and readability.
1 parent 7e8468f commit f676ddf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drf_excel/renderers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def render(self, data, accepted_media_type=None, renderer_context=None):
175175
last_col_letter = "G"
176176
if column_count:
177177
last_col_letter = get_column_letter(column_count)
178-
self.ws.merge_cells("A1:{}1".format(last_col_letter))
178+
self.ws.merge_cells(f"A1:{last_col_letter}1")
179179

180180
cell = self.ws.cell(row=1, column=1, value=header_title)
181181
set_cell_style(cell, header_style)
@@ -322,7 +322,7 @@ def _make_body(self, body, row, row_count):
322322
if "row_color" in row:
323323
last_letter = get_column_letter(column_count)
324324
cell_range = self.ws[
325-
"A{}".format(row_count) : "{}{}".format(last_letter, row_count)
325+
f"A{row_count}" : f"{last_letter}{row_count}"
326326
]
327327
fill = PatternFill(fill_type="solid", start_color=row["row_color"])
328328
for r in cell_range:

0 commit comments

Comments
 (0)