Re: Django's CVB - Roadmap?

2012-06-05 Thread Xavier Ordoquy
Hi, I also had a couple of issues with Django's generic CBV. My feeling is it raises a lot of frustration because it feels like there isn't much missing. I've been playing with a few solutions to work around that. I started a small proof of concept on chaining GCBV and a few other goodies. I'm a

Re: Django's CVB - Roadmap?

2012-06-05 Thread Mikhail Korobov
If you pollute the namespace with small helper functions you can test them independently and use them outside single CBV. This style also helps to write less coupled code - all dependencies are visible (they are all in functions' params list) so this forces developer to rethink the decompositio

Re: Django's CVB - Roadmap?

2012-06-05 Thread Albert O'Connor
I did mean shouldn't, sorry about that. We seem to have agreement that when it comes to mixins and the depth of the inheritance hierarchy it easy to go astray, or at least generic CBV did. From that I would argue it is difficult to write a good mixin. I disagree with your digestion line of thinki

Re: Django's CVB - Roadmap?

2012-06-05 Thread Donald Stufft
On Tuesday, June 5, 2012 at 11:11 AM, Albert O'Connor wrote: > > Both the Built in Generic Class Based Views, and Class Based Views > > in general are great. Generic Class Based Views are not awesome when > > your view is not generic. > > > > > My experience is using Generic Class Based Views

Re: Django's CVB - Roadmap?

2012-06-05 Thread Albert O'Connor
> Both the Built in Generic Class Based Views, and Class Based Views > in general are great. Generic Class Based Views are not awesome when > your view is not generic. My experience is using Generic Class Based Views as an inspiration for ones own Class Based Views lead to a bad user experience, b

Re: Django's CVB - Roadmap?

2012-06-05 Thread Zach Mathew
On Tuesday, June 5, 2012 10:12:45 AM UTC-4, dstufft wrote: > > On Tuesday, June 5, 2012 at 9:55 AM, Zach Mathew wrote: > > For example, I would avoid unit testing the "get_context_data" method on a > CBV and instead have a test that performs a request on the view and tests > the context variable

Re: Django's CVB - Roadmap?

2012-06-05 Thread Donald Stufft
On Tuesday, June 5, 2012 at 10:35 AM, Carl Meyer wrote: > > > On 06/05/2012 08:12 AM, Donald Stufft wrote: > > In order to do this with FBV's i'd either need to modify the existing > > FBV to accept > > a parameter that says if it should filter by logged in user or not or > > copy/paste > > the c

Re: Django's CVB - Roadmap?

2012-06-05 Thread Carl Meyer
On 06/05/2012 08:12 AM, Donald Stufft wrote: > In order to do this with FBV's i'd either need to modify the existing > FBV to accept > a parameter that says if it should filter by logged in user or not or > copy/paste > the code into a new FBV. Not true, you can also have a function view that r

Re: Django's CVB - Roadmap?

2012-06-05 Thread Donald Stufft
On Tuesday, June 5, 2012 at 9:55 AM, Zach Mathew wrote: > I'm not suggesting that CBVs make it harder to test (I actually think it > should be no different because the tests should avoid being implementation > specific). I just feel that the pattern of testing/refactoring is different > than the

Re: Django's CVB - Roadmap?

2012-06-05 Thread Donald Stufft
On Tuesday, June 5, 2012 at 9:29 AM, Albert O'Connor wrote: > Class Based View are awesome, except the ones which are built in? > > Both the Built in Generic Class Based Views, and Class Based Views in general are great. Generic Class Based Views are not awesome when your view is not generic. >

Re: Django's CVB - Roadmap?

2012-06-05 Thread Zach Mathew
I'm not suggesting that CBVs make it harder to test (I actually think it should be no different because the tests should avoid being implementation specific). I just feel that the pattern of testing/refactoring is different than the typical TDD approach (one could argue that this is not necessar

Re: Django's CVB - Roadmap?

2012-06-05 Thread Albert O'Connor
Class Based View are awesome, except the ones which are built in? I agree, as has been suggested, that if you make a really flat class based views like the admin itself, you can gain some benefits, but I still think those benefits are heavily tied to assumptions one can make in a specific problem

Re: Django's CVB - Roadmap?

2012-06-05 Thread Donald Stufft
On Tuesday, June 5, 2012 at 9:05 AM, Albert O'Connor wrote: > My feeling is that though some people might have uses for CBV, we > shouldn't be suggesting that developers should prefer CBV to function > based views. When it comes to maintainability, FBV are better, and I > would agree that they are

Re: Django's CVB - Roadmap?

2012-06-05 Thread Albert O'Connor
My feeling is that though some people might have uses for CBV, we shouldn't be suggesting that developers should prefer CBV to function based views. When it comes to maintainability, FBV are better, and I would agree that they are more Pythonic. When I tried to use CBV, I found the inheritance sem

Re: Django's CVB - Roadmap?

2012-06-04 Thread Marc Tamlyn
There is a plan to do some work on the docs at the djangocon sprints - in particular trying to get some examples of when you 'could' and when you 'should not' use the generic CBVs. With regards to Zach's point about TDD testing - some of that may simply be familiarity. I don't know about you bu

Re: Django's CVB - Roadmap?

2012-06-04 Thread Luke Plant
On 01/06/12 15:54, Jacob Kaplan-Moss wrote: > On Fri, Jun 1, 2012 at 10:14 AM, Victor Hooi wrote: >> The reason for my post - is there anything from the Django core as a whole >> on this? What's the future roadmap like in terms of CBV's? Are there going >> to be any changes to it, or are we safe t

Re: Django's CVB - Roadmap?

2012-06-04 Thread Zach Mathew
Glad to see this debate happening, because for a long time I felt like I was the only one who had issues with CBVs. I forced myself to use CBVs (custom and generics) on two major projects and I'm still struggling to see the real value in them. Luke's post did an excellent job of articulating th

Re: Django's CVB - Roadmap?

2012-06-04 Thread Zach Mathew
Glad to see this debate happening, because for a long time I felt like I was the only one who had issues with CBVs. I forced myself to use CBVs (custom and generics) on two major projects and I'm still struggling to see the real value in them. Luke's post did an excellent job of articulating th

Re: Django's CVB - Roadmap?

2012-06-04 Thread Hanne Moa
On 1 June 2012 16:54, Jacob Kaplan-Moss wrote: > I think this might be a situation where we need some more feedback > from the community and some more time to decide what the right move > here is. > > So... what do *you* think? I've used CBV's in one app so far, and have wound up only using View

Re: Django's CVB - Roadmap?

2012-06-04 Thread Meshy
Still sounds like an issue with the docs to me, and while they do still have some issues, I'm a big supporter of the CBVs. I've posted this here before, but http://ccbv.co.uk/ really helps cut out most of the pain of the "looking through the source code" stage of understanding the CBVs because

Re: Django's CVB - Roadmap?

2012-06-03 Thread mjl Martin J. Laubach
> > This is the real issue. The docs. It's one of the issues, but I'm not really convinced it is the only one. My experience with CBV usually has gone like this: 1. "I need a view, let's do it with CBV" 2. "Oh hey, that was easy!" 3. "I need some more functionality" 4

Re: Django's CVB - Roadmap?

2012-06-02 Thread Reinout van Rees
On 01-06-12 16:54, Jacob Kaplan-Moss wrote: I think as a whole we're divided. Luke's opinions differ from mine, and it's entirely unclear to me who's "right" or even if there's a "right" to be had. And that's just the two of us! I think this might be a situation where we need some more feed

Re: Django's CVB - Roadmap?

2012-06-01 Thread Alex Ogier
On Fri, Jun 1, 2012 at 3:45 PM, Iván Raskovsky wrote: > Hi there, IMHO I think we are discussing two different topics here. > > The first one is documentation... > > The second one is the actual Generic CBV... There's a third complaint that several people have mentioned that is deeper than both t

Re: Django's CVB - Roadmap?

2012-06-01 Thread Iván Raskovsky
Hi there, IMHO I think we are discussing two different topics here. The first one is documentation. I've just added a page to the wiki outlining the actual state of the CVB docs and some ideas on how we can improve it. Please fell free to expand/object/modify/destroy what I've written. I hope that

Re: Django's CVB - Roadmap?

2012-06-01 Thread Steven Cummings
The docs around the provided CBVs and mixins are an issue, but also what is missing is that programmers seem to still think those that are provided should work for more cases than they probably do. When the narrative for CBVs is documented, should Django focus on mixins and state the expected limit

Re: Django's CVB - Roadmap?

2012-06-01 Thread Adam "Cezar" Jenkins
On Fri, Jun 1, 2012 at 12:04 PM, Michael wrote: > I am not ready to judge right now wether they are a good idea or not. > > I can completely agree that documentation makes the views more difficult > then they actually are. Every time I create a new view, I find myself going > to the source. I thi

Re: Django's CVB - Roadmap?

2012-06-01 Thread Michael
I am not ready to judge right now wether they are a good idea or not. I can completely agree that documentation makes the views more difficult then they actually are. Every time I create a new view, I find myself going to the source. I think this is a case where the learning curve initially is a l

Re: Django's CVB - Roadmap?

2012-06-01 Thread Donald Stufft
I tend to agree, in general, with the reply that there should be a function based api to cover the 80% use case, but in the case of Django's CBV's this is likely covered by the as_view method. On Friday, June 1, 2012 at 10:54 AM, Jacob Kaplan-Moss wrote: > On Fri, Jun 1, 2012 at 10:14 AM, Victo

Re: Django's CVB - Roadmap?

2012-06-01 Thread Jacob Kaplan-Moss
On Fri, Jun 1, 2012 at 10:14 AM, Victor Hooi wrote: > The reason for my post - is there anything from the Django core as a whole > on this? What's the future roadmap like in terms of CBV's? Are there going > to be any changes to it, or are we safe to assume things will be as they are > now. I thi

Django's CVB - Roadmap?

2012-06-01 Thread Victor Hooi
Hi, I was reading the blog post from Luke Plant recently on his views on Django's CBVs: http://lukeplant.me.uk/blog/posts/djangos-cbvs-were-a-mistake/ As well as the reply here: http://www.boredomandlaziness.org/2012/05/djangos-cbvs-are-not-mistake-but.html The reason for my post - is there a