djangosnippets.org: Latest snippets posted by alcideshttps://djangosnippets.org/users/alcides/2008-07-27T14:45:32.840671-05:00alcidesDelete View
2008-07-27T14:45:32.840671-05:00alcideshttps://djangosnippets.org/snippets/920/<p>Usage:
</p>
<p>@login_required
def action_delete(request,object_id):
return delete_view(request,object_id,ActionItem)
</p>
Freely redistributableRender (with RequestContext)
2008-07-27T14:43:58.138956-05:00alcideshttps://djangosnippets.org/snippets/919/<p>In order to context_processors work, you need to use the RequestContext instead of Context.</p>
<p>This is a shortcut I use.</p>
Freely redistributablePygmentation
2008-06-24T10:23:21.299635-05:00alcideshttps://djangosnippets.org/snippets/822/<p>Usage: (if you save it as pigmentation.py as I did)</p>
<p>{% load pigmentation %}
{% autoescape off %}
{{ somevariable|pygmentize }}
{% endautoescape %}</p>
<p>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 …</p>
Freely redistributableDelicious Tag
2008-06-23T06:34:58.091240-05:00alcideshttps://djangosnippets.org/snippets/819/<p>Just add it in templatetags/delicious.py</p>
<p>In your template:</p>
<p><h3>Del.icio.us</h3></p>
<p><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></p>
Freely redistributable