On 01/10/10 16:25, Brandon Konkle wrote:
On Oct 1, 2010, at 10:20 AM, Alex Gaynor wrote:

Not really.  The big win from a class-based view is not being able to
store state, you can do that with local variables, it's being able to
override parts of the behavior without needing to rewrite the entire
view, or add 101 parameters.
If you're storing state with local variables, though, don't you end up having 
to pass 101 parameters around to your methods?

-Brandon


This is a very good point - one of the reasons it's nice to have self.request is so you don't end up with ridiculous method signatures. It's also a lot easier to write inflexible methods if you don't have state on self - if I'm in, say, get_form(), and I want to change the form I have based on the arguments in the URL (or anything elsewhere in the class), I can't do that unless someone thought to pass those variables in initially in the method signature.

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