On 01/10/10 11:17, Luke Plant wrote:
Passing things around between '_common' and GET and POST makes a simple
view much more complex than it needs to be, especially when you have
various local variables that you now have to assign in some way. In the
end you will end up just routing it all to the one method:

....def GET(self, *args, **kwargs):
........return self._common(*args, **kwargs)

....def POST(self, *args, **kwargs):
........return self._common(*args, **kwargs)

This is just 4 lines of annoying boilerplate to undo the dispatching
that was 'helpfully' done for you.

I would definitely support a 'request' method (perhaps call it
'dispatch'?) that allows us to avoid that logic.  I suspect that every
view I've created that used a form would be hampered by having dispatch
based on HTTP verb done first

There's nothing stopping Django shipping a base view which just calls a request method, and then another base view which inherits from that and does method-based dispatch - we shouldn't add too many classes, else it'll be a documentation nightmare, but that seems a sensible split.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-develop...@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