Django: TextChoices appearing in array as the __str__ representation and not as the value

Viewed 14

I have the following field in my model:

    schedule = models.CharField(
        choices=WorkScheduleType.choices,
        max_length=255,
        unique=True,
    )

This behaves as expected when I do something like this:

print(schedule)
> DAILY

But when I do something like this:

print([schedule])

It renders like this:

["WorkScheduleType<DAILY>"]

Why is this? Is there a proper way to add the text value to the array?

0 Answers
Related