For example, we have choicefield in models :
1 2 3 4 5 6 7 8 | class Employee(CommonInfo): PROFILE_CHOICES = ( (1, _("Hello")), (2, _("World")), ) name = models.CharField(max_length=255, unique=True) profile = models.IntegerField(choices=PROFILE_CHOICES , default=1) |
To showed value of profile in template, we can use
1 | object.get_{name-of-choicefield}_display |
So, example for this case will be object.get_profile_display