Re: Alternatives to CBVs (class based views)

2012-09-19 Thread Russell Keith-Magee
On Wed, Sep 19, 2012 at 6:42 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Thanks for clarifying, I see where my initial confusion was now. > > The reason this leak hadn't affected our apps was because we didn't use > __init__ to set up the view, instead

Re: Alternatives to CBVs (class based views)

2012-09-19 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for clarifying, I see where my initial confusion was now. The reason this leak hadn't affected our apps was because we didn't use __init__ to set up the view, instead all the state logic was placed into __call__. Never the less, having a class call return a HTTPResponse will break class

Re: Alternatives to CBVs (class based views)

2012-09-18 Thread Russell Keith-Magee
On Tue, Sep 18, 2012 at 7:24 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Russell, > > On a separate note, I am curious about these 'copy-on-call' leaks, and I > have not seen this behaviour documented anywhere else. > > "The abstraction of the

Re: Alternatives to CBVs (class based views)

2012-09-18 Thread Cal Leeming [Simplicity Media Ltd]
Russell, On a separate note, I am curious about these 'copy-on-call' leaks, and I have not seen this behaviour documented anywhere else. "The abstraction of the copy-on-call can leak in surprising ways. Some users will try to set up state using an __init__ method (common practice). If any of the

Re: Alternatives to CBVs (class based views)

2012-09-14 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Sep 14, 2012 at 12:12 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd] > wrote: > > Hi all, > > > > There is a lot of debate on whether there is a real future for the

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Russell Keith-Magee
On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Hi all, > > There is a lot of debate on whether there is a real future for the Django > CBVs (class based views). Sigh. No - there isn't *any* debate about the future of CBVs.

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Dan Gentry
It would be helpful to see some more complex examples with these classes. One thing I like about the CBVs is that they include all of the necessary code for common functions. I have used them extensively (once I figured them out). On Wednesday, September 12, 2012 12:59:12 PM UTC-4, Cal

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
Ah, thanks for letting me know - the original snippet by eallik had support for this, but I must have stripped it out not realising. On Thu, Sep 13, 2012 at 1:34 AM, Matt Schinckel wrote: > One really small nitpick: when returning a 405, it is a requirement that > you return

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Matt Schinckel
One really small nitpick: when returning a 405, it is a requirement that you return a header with the acceptable methods: > > > 10.4.6 405 Method Not Allowed > The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Kurtis
I guess I'm the only one who loves Django's CBVs :( Maybe some good documentation / third-party tutorial is in order? haha Thanks for sharing though, Cal! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Melvyn Sopacua
Op 12 sep. 2012 18:58 schreef "Cal Leeming [Simplicity Media Ltd]" < cal.leem...@simplicitymedialtd.co.uk> het volgende: > > Hi all, > > There is a lot of debate on whether there is a real future for the Django CBVs (class based views). ..snip.. > > Any thoughts? > I understand what you're

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
On Wed, Sep 12, 2012 at 7:44 PM, Javier Guerra Giraldez wrote: > On Wed, Sep 12, 2012 at 11:58 AM, Cal Leeming [Simplicity Media Ltd] > wrote: > > So, here is a really minimalistic way of having class based views, > without > > the fuss.

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Javier Guerra Giraldez
On Wed, Sep 12, 2012 at 11:58 AM, Cal Leeming [Simplicity Media Ltd] wrote: > So, here is a really minimalistic way of having class based views, without > the fuss. > > http://djangosnippets.org/snippets/2814/ looks nice. i like that it respects the idea

Alternatives to CBVs (class based views)

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Hi all, There is a lot of debate on whether there is a real future for the Django CBVs (class based views). Personally, I find them tedious, and just wanted a way to keep my views clean. So, here is a really minimalistic way of having class based views, without the fuss.