django - I have a list of objects and would like to return an attribute with another attribute -


if objects {(title: 'one', content: 'foo'), (title: 'two', content: 'bar')} how go getting 'for' , 'bar' template?

something this:

{% content in content_list content.title='one'} {{ content.content }} 

resulting in 'foo'.

{% content in content_list content.title='two'} {{ content.content }} 

resulting in 'bar'.

try -

{% content in content_list %}     {% if content.title == 'two' %}         {{ content.content }}     {% else %}         {{ content.content }}     {% endif %} {% endfor %} 

note: if list small


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -