Created
April 12, 2010 03:56
-
-
Save ecarter/363262 to your computer and use it in GitHub Desktop.
super easy 'object as var' django templatetag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% my_items object as item_list %} | |
{% if item_list %} | |
<ul> | |
{% for item in item_list %} | |
<li>{{ item.name }}</li> | |
{% endfor %} | |
</ul> | |
{% else %} | |
<p>no items found.</p> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment