#9081: [patch] More flexible render_to_response()
---------------------------------------------+------------------------------
          Reporter:  bhagany                 |         Owner:  ccahoon
            Status:  new                     |     Milestone:         
         Component:  HTTP handling           |       Version:  1.0    
        Resolution:                          |      Keywords:         
             Stage:  Design decision needed  |     Has_patch:  1      
        Needs_docs:  0                       |   Needs_tests:  0      
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by ccahoon):

 @bhagany: render_to_response is what developers need in a huge number of
 cases to quickly render a template in a view. render_to_string covers many
 other cases.

 The way that this patch provides additional functionality is a bit
 confusing, I think. By passing in the response class that we will be
 using, then passing in arguments to be provided to that response class, we
 have already had to use the class names and arguments we would need to
 just instantiate a response. Doesn't it seem like we would be better off
 creating the response anyway? It doesn't even seem like extra work, and
 that way we have the option to actually manipulate the response before it
 gets returned. On top of that, it just makes me feel uncomfortable (code
 smell?) to provide the class name and arguments for it in the same
 argument list -- it does not seem clean.

 I understand the desire for the shortcut, but I think it comes at the
 expense of the simplicity of the render_to_response shortcut. I think a
 better option might be to add another one, which has greater flexibility
 and is a bit more intuitive. But it could be that I am being too much of a
 stickler.

 Maybe we should bring up the discussion on the Django Developers Google
 Group?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9081#comment:9>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to