[Answered ]-Show Integer choice value as Characters (not integer) in Admin

2👍

The issue is that your __str__ method must return an object of type str.

Since the index is what’s stored in self.region, you can simply do a lookup:

class Region(models.Model):
    ...
    def __str__(self):
        return Region_CHOICES[self.region][1]
👤dursk

0👍

Just type cast to string

def __str__(self):
    return str(self.region)

This works for me

Leave a comment