djangosnippets.org: Latest snippets posted by MichaelAnckaerthttps://djangosnippets.org/users/MichaelAnckaert/2008-12-22T12:38:32.169941-06:00MichaelAnckaertBoolean Image Flag TemplateTag
2008-12-22T12:38:32.169941-06:00MichaelAnckaerthttps://djangosnippets.org/snippets/1257/<p>Something I end up doing all the time, making a boolean variable show up as a nice image. With this code you can do the following:</p>
<p><code>{% boolean_img user.is_active %}</code></p>
<p>And get the following output:
<code><img src="/media/icons/accept.png" alt="True" /></code></p>
<p>All you need to do is use the custom templatetag code, …</p>
Freely redistributable