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
On Tue, Jun 5, 2012 at 9:00 PM, Anssi Kääriäinen
wrote:
> Understood & agreed (the "this model is dynamic made explicit" part
> seems really important specifically).
>
> I am afraid of the hard-coding of meta.swappable must be 'SOME_VAR'
> which then references settings.SOME_VAR, and that this is
I recently worked with PyJade's maintainer to resolve a bug I experienced
when creating Jade templates for Django.
I haven't reviewed all of the Syrus's changes to his codebase, but PyJade
should now allow all Django tags (including custom tags) when prefixed by
"-".
For example:
- any_tag
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
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
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
> 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
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
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
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
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
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.
>
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
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
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
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
On Jun 5, 2:44 pm, Russell Keith-Magee
wrote:
> Two significant reasons:
>
> Firstly, if we use the Meta attribute approach, we can raise a
> specific validation error when the user has an app with a model that
> references auth.User directly, and User has been swapped out. This is
> mostly useful
On Tue, Jun 5, 2012 at 3:56 AM, Anssi Kääriäinen
wrote:
> On Jun 4, 6:12 pm, Russell Keith-Magee
> wrote:
>> * The swapping mechanic is set up using a new Meta option on models
>> called 'swappable' that defines the setting where an alternate model
>> can be defined. Technically, the swappable o
18 matches
Mail list logo