Hello Guys,

favorite 
<http://stackoverflow.com/questions/40065604/django-variable-in-style-width-attribute#>

Why the template tag call {% get_percentage question.pk choice.pk %} works 
inside the span tag, but doesn't work in style (width) attribute?

What is wrong?

 {% for choice in question.choice_set.all %}
        <strong>{{ choice.choice_text }}</strong>
        <span class="pull-right">{% get_percentage question.pk choice.pk 
%}%</span>
        <div class="progress progress-danger active">
            <div class="bar" style="width:{% get_percentage question.pk 
choice.pk %}%"></div>
        </div>
 {% endfor %}

I am using Python 3.5.2 and Django 1.10.2

PS: I did the same question on StackOverflow: 
http://stackoverflow.com/q/40065604/5498125, but I have no answers yet.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8148661a-77ed-4b2b-b68a-90dd1df1376a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to