Interestingly, I made a snippet [1] two years ago something like this.
Granted, it was a bit more convoluted: you build a decorator and use
that everywhere (I was a bit anal about DRY, so you can render a
prefix template path for that decorator)

Personally, I just use direct_to_template for projects now, because it
is built in (and extra abstraction layers make it that bit harder to
follow code).
I like Simon's wrapper but have never got around to using it. It's on
my list to use for my next project though.

[1] http://www.djangosnippets.org/snippets/133/

On Oct 17, 9:51 am, Justin Lilly <jus...@justinlilly.com> wrote:
> Just to add something a little different, there is a 5th option, that
> may fall into place w/ #4. The @render_to decorator. works like:
>
> @render_to('myapp/mypage.html')
> def home(request, foo):
>     return {'foo':foo}
>
> http://www.djangosnippets.org/snippets/821/
>
> This isn't a 1:1 replacement, but I've started using it in all of my
> projects.
>
>  -justin
>
>  signature.asc
> < 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to