

Django: The Easy Form Views Pattern Controversy - pydanny
http://pydanny.com/the-easy-form-views-pattern-controversy.html

======
obviouslygreen
So right off the bat, explicit linkbait: _This isn't a controversy 'per se',
except perhaps in the feverish depths of my brain._

Of course the intention was to get attention, though if you're going to post
something here with a blatant grab for clicks, shouldn't you at least include
some content? Not only do you state right up front that it's unlikely anyone
but you will find this controversial, you present a point made to you showing
that the approach you're discussing is fundamentally flawed.

Summary: "This is what I did. It saved me about three lines of code. Then
someone pointed out that I was actually mishandling requests by ignoring the
framework's explicitly-available standard identifier provided to me for
exactly this purpose. Not only that, it causes inconsistent misbehavior in
different versions of the framework."

I'm certainly guilty of looking for ways to cut corners like this -- I think
we all are -- but being up front about "this was a bad idea" and changing the
tone of the article to reflect a lesson learned instead of what's very clearly
a suggestion you later discovered you shouldn't have been making would've made
it a much more useful and succinct read.

~~~
pydanny
It wasn't intentional.

I've been asked to post this on my blog for years. At the same time, I've had
a number of people I respect state that it's not a good idea. I wasn't sure
how to handle things, so I wrote this in one big chunk.

However, I think you may have a point about the tone. Let me think on it.

------
dschep
Why not just use this:

    
    
        form = MyForm(request.POST if request.method == 'POST' else None)

~~~
daGrevis
This is more explicit, hence better.

