It was my understanding (maybe incorrect) that using enumeration type text choices for CharFields is useful because your database stores less characters on the database but you can still work with a human readable values. However it seems counter-productive when you are posting data from the frontend to the backend because the frontend has to post the value that will be stored in the database, not the human readable one. For example:
class MyModel(models.Model):
class Animals(models.TextChoices):
ALLIGATOR = 'a', 'Alligator'
BEAR = 'b', 'Bear'
COYOTE = 'c', 'Coyote'
animal = models.CharField(max_length=20, choices=Animals.choices)
If i post {animal: 'Coyote'} to the endpoint, it will say 'animal is not a valid choice'. I have to post {animal: 'c'} instead. Is there a way I can get the MyModelSerializer to accept human readable values instead of having to setup frontend select element options to have differing labels and values?