#12329: "template" view decorator, allows to completely isolate views from templates ------------------------------------+--------------------------------------- Reporter: gurunars | Owner: nobody Status: closed | Milestone: Component: Uncategorized | Version: 1.1 Resolution: wontfix | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ------------------------------------+--------------------------------------- Changes (by russellm):
* status: new => closed * needs_better_patch: => 0 * resolution: => wontfix * needs_tests: => 0 * needs_docs: => 0 Comment: This has been requested several times, and rejected. I (and others in the core) simply don't see that using decorators in this way makes anything clearer. The current contract for a view is that it accepts a request, returns a response. If you use a decorator to modify templates, this contract becomes "returns a response, or a response holder, or a dictionary". This isn't an improvement. An alternate proposal that *does* have some support in the core is the idea of a TemplateResponse - that is, that you can return a response whose template will be lazily evaluated, allowing decorators, middlewares, or view wrappers to modify the template that is used. This means a view can return a template and a context, but the actual template that is used can be modified by something higher up in the chain. For details, see ticket #12815. -- Ticket URL: <http://code.djangoproject.com/ticket/12329#comment:1> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.