Login

Snippets by alcides

Snippet List

Delete View

Usage: @login_required def action_delete(request,object_id): return delete_view(request,object_id,ActionItem)

  • view
  • delete
Read More

Pygmentation

Usage: (if you save it as pigmentation.py as I did) {% load pigmentation %} {% autoescape off %} {{ somevariable|pygmentize }} {% endautoescape %} There already a few of this code around, but this one is pretty clean, and includes css. It also works in both the development server and Dreamhost (python2.4 in my django config) without any unicode problems.

  • filter
  • tag
  • templatetag
  • pygments
  • code
  • colorize
  • color
Read More

Delicious Tag

Just add it in templatetags/delicious.py In your template: <h3>Del.icio.us</h3> <ul class="list"> {% load delicious %} {% load_delicious_links %} {% for link in delicious_links %} <li><a href="{{link.link}}">{{link.title|safe}}</a></li> {% endfor %} </ul>

  • tag
  • delicious
Read More

alcides has posted 4 snippets.