Skip to content

Commit

Permalink
Update api/survey/models.py
Browse files Browse the repository at this point in the history
Co-authored-by: code-review-doctor[bot] <72320148+code-review-doctor[bot]@users.noreply.github.com>

convert to fstring

convert to charfield

fixed enums

migrations
  • Loading branch information
Tllew committed Feb 12, 2024
1 parent 681b61a commit 002b37b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions api/survey/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class RecommendationChoiceType(models.TextChoices):
class SatisfactionRatingEnum(models.TextChoices):
STRONGLY_DISAGREE = "STRONGLY DISAGREE", "STRONGLY DISAGREE"
DISAGREE = "DISAGREE", "DISAGREE"
NEITHER_AGREE_NOR_DISAGREE = "NEITHER AGREE NOR DISAGREE", "NEITHER AGREE NOR DISAGREE"
NEITHER_AGREE_NOR_DISAGREE = "NEUTRAL", "NEUTRAL"
AGREE = "AGREE", "AGREE"
STRONGLY_AGREE = "STRONGLY AGREE", "STRONGLY AGREE"


class UserAccountEnum(models.TextChoices):
VERY_DIFFICULT = "VERY DIFFICULT", "VERY DIFFICULT"
DIFFICULT = "DIFFICULT", "DIFFICULT"
NEITHER_DIFFICULT_NOR_EASY = "NEITHER DIFFICULT NOR EASY", "NEITHER DIFFICULT NOR EASY"
NEITHER_DIFFICULT_NOR_EASY = "NEUTRAL", "NEUTRAL"
EASY = "EASY", "EASY"
VERY_EASY = "VERY EASY", "VERY EASY"

Expand Down
16 changes: 8 additions & 8 deletions api/survey/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.9 on 2024-02-12 11:50
# Generated by Django 4.2.9 on 2024-02-12 15:53

import django.contrib.postgres.fields
from django.db import migrations, models
Expand Down Expand Up @@ -37,7 +37,7 @@ class Migration(migrations.Migration):
),
(
"recommendation",
models.TextField(
models.CharField(
choices=[
("VERY_DISSATISFIED", "VERY_DISSATISFIED"),
("DISSATISFIED", "DISSATISFIED"),
Expand All @@ -47,7 +47,7 @@ class Migration(migrations.Migration):
]
),
),
("other_detail", models.TextField(blank=True, null=True)),
("other_detail", models.TextField(blank=True, default="")),
(
"experienced_issue",
django.contrib.postgres.fields.ArrayField(
Expand All @@ -68,12 +68,12 @@ class Migration(migrations.Migration):
),
(
"helpful_guidance",
models.TextField(
models.CharField(
blank=True,
choices=[
("STRONGLY DISAGREE", "STRONGLY DISAGREE"),
("DISAGREE", "DISAGREE"),
("NEITHER AGREE NOR DISAGREE", "NEITHER AGREE NOR DISAGREE"),
("NEUTRAL", "NEUTRAL"),
("AGREE", "AGREE"),
("STRONGLY AGREE", "STRONGLY AGREE"),
],
Expand All @@ -82,19 +82,19 @@ class Migration(migrations.Migration):
),
(
"user_account_process",
models.TextField(
models.CharField(
blank=True,
choices=[
("VERY DIFFICULT", "VERY DIFFICULT"),
("DIFFICULT", "DIFFICULT"),
("NEITHER DIFFICULT NOR EASY", "NEITHER DIFFICULT NOR EASY"),
("NEUTRAL", "NEUTRAL"),
("EASY", "EASY"),
("VERY EASY", "VERY EASY"),
],
default="",
),
),
("service_improvements_feedback", models.TextField(blank=True, null=True)),
("service_improvements_feedback", models.TextField(blank=True, default="")),
],
options={
"abstract": False,
Expand Down
4 changes: 2 additions & 2 deletions api/survey/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SurveyResponse(TimestampableModel):
experienced_issue = ArrayField(models.CharField(choices=ExperiencedIssueEnum.choices), blank=True, null=True)
helpful_guidance = models.CharField(choices=SatisfactionRatingEnum.choices, blank=True, default="")
user_account_process = models.CharField(choices=UserAccountEnum.choices, blank=True, default="")
service_improvements_feedback = models.TextField(blank=True, null=True)
service_improvements_feedback = models.TextField(blank=True, default="")

def __str__(self):
return "SurveyResponse #{0} - {1}".format(self.id, self.recommendation)
return f"SurveyResponse #{self.id} - {self.recommendation}"

0 comments on commit 002b37b

Please sign in to comment.