Your Linux Data Center Experts

I just posted a Django snippet that (ab)uses a decorator to change how you call templates in Dango views. For example, it makes my view code something like this:

####################################
@with_template('friends/index.html')
def friends(request, context, username):
   context['user'] = User.objects.get(username = username)

And the view:

{% extends "base.html" %}
{% block content %}
<h1>{{ user.username }}'s Friends</h1>
comments powered by Disqus

Join our other satisfied clients. Contact us today.