djangosnippets.org: Latest snippets posted by cogathttps://djangosnippets.org/users/cogat/2009-04-26T00:57:36.677536-05:00cogatImageMagick commands from Django Templates
2009-04-26T00:57:36.677536-05:00cogathttps://djangosnippets.org/snippets/1466/<p>A template filter which wraps imagemagick's <code>convert</code> command. The filter acts upon a source image path, and returns the filtered image path.</p>
<pre><code>usage: {{ source_path|convert:"-resize 64x64\!" }}
</code></pre>
<p>The filter parameter is the processing arguments for an ImageMagick 'convert' command. See e.g. http://www.imagemagick.org/Usage/resize/</p>
<p>Every image created is saved in a cache …</p>
Freely redistributablerender_as_template template tag
2009-03-13T22:55:23.754637-05:00cogathttps://djangosnippets.org/snippets/1373/<p>This is a template tag that works like <code>{% include %}</code>, but instead of loading a template from a file, it uses some text from the current context, and renders that as though it were itself a template. This means, amongst other things, that you can use template tags …</p>
Freely redistributableA GET string modifier templatetag
2008-12-11T18:28:32.234976-06:00cogathttps://djangosnippets.org/snippets/1243/<p>This template tag takes the current GET query, and modifies or adds the value you specify. This is great for GET-query-driven views, where you want to provide URLs which reconfigure the view somehow.</p>
<p><strong>Example Usage:</strong></p>
<p><code>{% get_string "sort_by" "date" %}</code> returns <code>all=your&current=get&variables=plus&sort_by=date</code></p>
Freely redistributable