Product Choice add underscores in my tag.

when i access the tag from product object it gets the first value from the choices with underscores, and when i try

<p class="ui green big ribbon label">{{ product.tag.1 | upper }}</p>

it gets only only second letter.
I want to make the tag without underscores.


<div class="image">
    {% for image in product.product_image.all %}
    {% if image.thumbnail %}
    <img class="ui fluid rounded image" src="{{ image.image.url }}">
    {% endif %}
    {% if product.tag %}
    <p class="ui green big ribbon label">{{ product.tag | upper }}</p>
    {% endif %}
    {% endfor %}


TagsChoices = (
		(_('Featured'), _('Featured')),
		(_('Sale'), _('Sale')),
		(_('Clearance'), _('Clearance')),
		(_('Pre Order'), _('Pre Order')),
		(_('Out Of Stock'), _('Out Of Stock')),
		(_('Best Seller'), _('Best Seller')),

In template use:

{{ product.get_<foo>_display }}

<foo> is the field on which TagsChoices is used.

1 Like

Solved Thnaks Buddy.