Using widthratio tag properly

Posted by owca on Stack Overflow See other posts from Stack Overflow or by owca
Published on 2010-04-03T00:20:06Z Indexed on 2010/04/03 0:23 UTC
Read the original article Hit count: 544

Filed under:
|

Hi. In my application I need to show in template stocks for my products. So from product view I'm returning variable {{stock}} which is my amount and then I'm trying to use it in template :

<div class="bar_in" width="{% widthratio {{stock}} 10 100 %}px" style="background:black;"></div>

But it constantly give me "Could not parse the remainder: '{{stock}}' from '{{stock}}' " error. I've tried casting it as int but still the same problem. How to make it work properly ?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-templates