Skip to content
Snippets Groups Projects
Commit c6b96d4e authored by Jordan's avatar Jordan
Browse files

[add] première colonne = heure de réponse

parent 84378483
No related branches found
No related tags found
No related merge requests found
...@@ -20,8 +20,9 @@ class Survey(models.Model): ...@@ -20,8 +20,9 @@ class Survey(models.Model):
for question_id in question_ids: for question_id in question_ids:
columns.append(question_id.question) columns.append(question_id.question)
worksheet.write(0, 0, "Heure de réponse")
for i, fieldname in enumerate(columns): for i, fieldname in enumerate(columns):
worksheet.write(0, i, fieldname) worksheet.write(0, i+1, fieldname)
worksheet.col(i).width = 8000 # around 220 pixels worksheet.col(i).width = 8000 # around 220 pixels
base_style = xlwt.easyxf('align: wrap yes') base_style = xlwt.easyxf('align: wrap yes')
...@@ -45,9 +46,9 @@ class Survey(models.Model): ...@@ -45,9 +46,9 @@ class Survey(models.Model):
answers = answers_to_that_question_id.get_user_answers() answers = answers_to_that_question_id.get_user_answers()
else: else:
answers = False answers = False
print('-----answer', cell_index, answers) worksheet.write(row_index + 1, cell_index+1, str(answers), cell_style)
worksheet.write(row_index + 1, cell_index, str(answers), cell_style)
cell_index = cell_index + 1 cell_index = cell_index + 1
worksheet.write(row_index + 1, 0, str(user_input_id.create_date))
row_index = row_index + 1 row_index = row_index + 1
return workbook return workbook
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment