djangosnippets.org: Latest snippets posted by Tomekhttp://djangosnippets.org/users/Tomek/2010-12-23T08:31:36.065957-06:00Tomekcleat_list
2010-12-23T08:31:36.065957-06:00Tomekhttp://djangosnippets.org/snippets/2298/<p>Clear list from unwanted elements, within django template.
</p>
Freely redistributableis_in
2010-12-16T04:25:50.283686-06:00Tomekhttp://djangosnippets.org/snippets/2292/<p>I know in Django 1.2 we may acquire the same result using
{% if value in arg %} but I need this filter in Django 1.1.
</p>
Freely redistributablejoinstrings filter
2010-11-22T07:47:16.262099-06:00Tomekhttp://djangosnippets.org/snippets/2271/<p>In one situation I needed to join strings in template, so I wrote this filter.
</p>
<p>Use it like this:
</p>
<p>1)
</p>
<p>var = 23
</p>
<p>{{"I have eat %d apples today."|joinstrings:var}}
</p>
<p>-> "I have eat 23 apples today."
</p>
<p>var = '23'
</p>
<p>{{"I have eat %s apples today."|joinstrings:var}}
</p>
<p>-> "I have eat 23 …</p>
Freely redistributable