Login

Snippets by visgean

Snippet List

filter for simplifying creating data URI´s

This filter will return data URI for given file, for more info go to: [wikipedia](http://en.wikipedia.org/wiki/Data_URI_scheme) Sample Usage: ` <img src="{{ "/home/visgean/index.png"|dataURI }}"> ` will be filtered into: ` <img src="data:image/png;base64,iVBORw0..."> ` This is good for small images.

  • filter
  • mime
  • uri
  • data URI
Read More

grouper tag

I needed to display formset into table and I didn´t like solution I have found. So I have written this simple tag you can use it in templates like this: ` {% for row in formset|square_it:6 %} <tr> <td> </td> {% for form in row %} <td> {% for field in form %} {{ field }} {% endfor %} </td> {% endfor %} `

  • template
  • tag
  • templatetag
  • formset
Read More

visgean has posted 2 snippets.