[Django]-Add CSS class to django RadioSelect label

0👍

for those who will be looking at this question i found a trick….. i Don’t know what’s up with the RadioSelect() widget…. i rendered my template like this:

{% for choice in form.category_res %}
        <div class="custom-control custom-radio custom-control-inline">
            {{ choice.tag }}
            <label for="{{ choice.id_for_label  }}" class="custom-control-label">{{ choice.choice_label }}</label>
        </div>
{% endfor %}

(category_res) is my field with choices
I am know using django2.0 with python3.6 and i used bootstrap4.0 on my template… I hope this works for you

Leave a comment