Skip to content

Instantly share code, notes, and snippets.

@mstepniowski
Created June 3, 2009 13:04
Show Gist options
  • Save mstepniowski/122972 to your computer and use it in GitHub Desktop.
Save mstepniowski/122972 to your computer and use it in GitHub Desktop.
from annoying.decorators import render_to
@render_to('template.html')
def foo(request):
bar = Bar.object.all()
return {'bar': bar}
# equals to
from django.views.generic.simple import direct_to_template
def foo(request):
bar = Bar.object.all()
return direct_to_template('template.html', {'bar': bar})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment