I am using Django and I am wondering how I can accomplish this. It works fine in python in Linux but the HTML Templating language keeps saying it cannot parse the array.
{% if myvalue in ["128","256","512","768","1024","1536","2048","3072","5120","10240"] %}
<p> Hello World
{% endif %}
It says it cannot parse the remainder and then it displays the list.
Cédric Julien
81.2k16 gold badges131 silver badges134 bronze badges
asked Jan 3, 2012 at 14:26
TheMonkeyMan
9,2529 gold badges30 silver badges44 bronze badges
1 Answer 1
You can't create arbitrary lists in the Django templating system. You need to pass the created list via your view. See This question for a detailed discussion.
answered Jan 3, 2012 at 14:33
jeffknupp
6,3643 gold badges30 silver badges29 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default