djangosnippets.org: Latest snippets tagged with 'conditional'http://djangosnippets.org/tags/conditional/2014-05-11T23:54:10.973292-05:00Conditional INSTALLED_APPS entry
2014-05-11T23:54:10.973292-05:00tgandorhttp://djangosnippets.org/snippets/3048/<p>Some INSTALLED_APPLICATIONS applications may not be critical for your website to work - for example you may only need them for development - like 'django_extensions' or 'debug_toolbar'. They needn't be installed actually for the site to work. </p>
<p>This way you can avoid discussions with other developers if some application should …</p>
Freely redistributableEasy Conditional Template Tags
2009-05-29T23:21:06.909174-05:00fragsworthhttp://djangosnippets.org/snippets/1538/<p>This is a conditional templatetag decorator that makes it <em>very</em> easy to write template tags that can be used as conditions. This can help avoid template boilerplate code (e.g. setting a variable in your template to be used in a condition).</p>
<p>All you have to do is define a function …</p>
Freely redistributableSwitch/case conditional tags
2008-07-12T17:54:20.353658-05:00gabrielteratoshttp://djangosnippets.org/snippets/878/<p>This tag allow you to use C-like switch tag in your templates.
It is useful for sequencial and repetitive <code>{% ifequal %}</code> tags.</p>
<p>To install it in your project, you just need to follow <a href="http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system">these instructions</a></p>
Freely redistributablePyIf Template Tag (Conditional Tag)
2007-03-23T16:55:02.310000-05:00nstritehttp://djangosnippets.org/snippets/130/<p>Cheers to limodou for getting me thinking about this. The only problem with his implementation is that it doesn't support Django's "." syntax for accessing array/dict elements. In the Django style of allowing simple syntax for designers while allowing for greater flexibility, and less template duplication for conditionals that were …</p>
Freely redistributable