Skip to content
Snippets Groups Projects
Commit f4365d92 authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#264 Type-kolonne vises ikke i liten kodebok-pdf

parent d394ada8
No related branches found
No related tags found
1 merge request!99#263 og #264 Kolonneendring kodebok pdf
Pipeline #84024 passed with stages
in 2 minutes and 38 seconds
......@@ -38,15 +38,15 @@ PAGE_NUMBER_FONT = "Helvetica"
TABLE_STYLE = TableStyle(
[
("FONTSIZE", (0, 0), (3, 0), 16), # Header-fontsize
("BOTTOMPADDING", (0, 0), (3, 0), 10), # Header-padding bottom
("FONTSIZE", (0, 0), (-1, 0), 16), # Header-fontsize
("BOTTOMPADDING", (0, 0), (-1, 0), 10), # Header-padding bottom
(
"BACKGROUND",
(0, 0),
(3, 0),
(-1, 0),
HEADER_BG_COLOR,
), # Header background-color
("ALIGN", (0, 0), (3, 0), "CENTER"), # Header-text centered
("ALIGN", (0, 0), (-1, 0), "CENTER"), # Header-text centered
("GRID", (0, 0), (-1, -1), 1, colors.black), # Border around cells
]
)
......@@ -156,18 +156,28 @@ def get_codebook_data(database, small=False):
data_decode = []
# Add column-headers
data_code.append([HEADERS[0], HEADERS[3], HEADERS[1], HEADERS[2]])
data_decode.append([HEADERS[3], HEADERS[0], HEADERS[1], HEADERS[2]])
if small:
data_code.append([HEADERS[0], HEADERS[3], HEADERS[1]])
data_decode.append([HEADERS[3], HEADERS[0], HEADERS[1]])
else:
data_code.append([HEADERS[0], HEADERS[3], HEADERS[1], HEADERS[2]])
data_decode.append([HEADERS[3], HEADERS[0], HEADERS[1], HEADERS[2]])
# Add row data
for row in db_data_code:
data_code.append(
[row["word"], row["code"], row["category"], row["type"]]
)
if small:
data_code.append([row["word"], row["code"], row["category"]])
else:
data_code.append(
[row["word"], row["code"], row["category"], row["type"]]
)
for row in db_data_decode:
data_decode.append(
[row["code"], row["word"], row["category"], row["type"]]
)
if small:
data_decode.append([row["code"], row["word"], row["category"]])
else:
data_decode.append(
[row["code"], row["word"], row["category"], row["type"]]
)
return data_code, data_decode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment