Re: HowTo: Django view as a class

2008-08-29 Thread Horst Gutmann
Very interesting approach, going through subclassing HttpResponse for generating views. Just some more alternatives if you don't mind ;-) A couple of months ago, Arne Brodowski wrote some similar on his blog [1] also kind of using the servlet-split (a view-method per http-method). Also some time

Re: HowTo: Django view as a class

2008-08-28 Thread bobhaugen
I would be interested to try this in the context of a whole simple app, if you ever publish such a thing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: HowTo: Django view as a class

2008-08-28 Thread zvoase
An alternative is to use some metaclass programming, but to be honest it's more trouble than it's worth. This does actually help with RESTfulness, because it allows you to aggregate your views on a resource-centric basis, as a collection of atomic operations on a resource, and then you would defin

Re: HowTo: Django view as a class

2008-08-27 Thread Jenan Wise
V: Defining a __call__ method will make *instances* of the class callable. Calling the class itself will still just instantiate it. On Tue, Aug 26, 2008 at 7:00 AM, V <[EMAIL PROTECTED]> wrote: > > Hi! > > Interesting solution. > > Another possibility if you would like to stick with a class is to

Re: HowTo: Django view as a class

2008-08-26 Thread V
Hi! Interesting solution. Another possibility if you would like to stick with a class is to simply define a __call__ method on the class. Of course, this doesn't have to do anything with RESTfulness. V On Aug 26, 3:07 am, zvoase <[EMAIL PROTECTED]> wrote: > Hey Django users, just a quick sugge

HowTo: Django view as a class

2008-08-25 Thread zvoase
Hey Django users, just a quick suggestion which might help a few people. I have come up with a way of writing a Django view as a class. I've done this as part of an effort to write easier-to-understand RESTful apps, as this allows the grouping of similar views as different types of operation on a