From 776c3e08e1db2b8cbcc7142f57683bb5e9918b8a Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 28 Nov 2024 16:23:18 +0800 Subject: [PATCH] Questionnaire improvements --- docmanager_backend/questionnaires/admin.py | 10 +- ...lter_questionnaire_sqd0_answer_and_more.py | 148 ++++++++++++++++++ docmanager_backend/questionnaires/models.py | 2 +- 3 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 docmanager_backend/questionnaires/migrations/0002_alter_questionnaire_sqd0_answer_and_more.py diff --git a/docmanager_backend/questionnaires/admin.py b/docmanager_backend/questionnaires/admin.py index 8c38f3f..50ec7bc 100644 --- a/docmanager_backend/questionnaires/admin.py +++ b/docmanager_backend/questionnaires/admin.py @@ -1,3 +1,11 @@ from django.contrib import admin +from unfold.admin import ModelAdmin -# Register your models here. +from .models import Questionnaire + + +@admin.register(Questionnaire) +class QuestionnaireAdmin(ModelAdmin): + model = Questionnaire + search_fields = ["id", "date_submitted"] + list_display = ["id", "date_submitted"] diff --git a/docmanager_backend/questionnaires/migrations/0002_alter_questionnaire_sqd0_answer_and_more.py b/docmanager_backend/questionnaires/migrations/0002_alter_questionnaire_sqd0_answer_and_more.py new file mode 100644 index 0000000..eb19597 --- /dev/null +++ b/docmanager_backend/questionnaires/migrations/0002_alter_questionnaire_sqd0_answer_and_more.py @@ -0,0 +1,148 @@ +# Generated by Django 5.1.3 on 2024-11-28 07:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("questionnaires", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="questionnaire", + name="sqd0_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd1_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd2_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd3_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd4_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd5_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd6_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd7_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + migrations.AlterField( + model_name="questionnaire", + name="sqd8_answer", + field=models.CharField( + choices=[ + ("1", "Strongly Disagree"), + ("2", "Disagree"), + ("3", "Neither Agree nor Disagree"), + ("4", "Agree"), + ("5", "Strongly Agree"), + ("6", "N/A"), + ], + max_length=16, + ), + ), + ] diff --git a/docmanager_backend/questionnaires/models.py b/docmanager_backend/questionnaires/models.py index 00b94cc..564e728 100644 --- a/docmanager_backend/questionnaires/models.py +++ b/docmanager_backend/questionnaires/models.py @@ -74,7 +74,7 @@ class Questionnaire(models.Model): # SQD Questions SQD_CHOICES = ( - ("1", "Strongly disagree"), + ("1", "Strongly Disagree"), ("2", "Disagree"), ("3", "Neither Agree nor Disagree"), ("4", "Agree"),