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
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
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
> 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,
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
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
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
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
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
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
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
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
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
15 matches
Mail list logo