RestView - a class for creating a view that dispatches based on request.method (via) I finally got around to writing up a simple approach I’ve been using for REST-style view functions in Django that dispatch based on request.method.
RestView - a class for creating a view that dispatches based on request.method (via) I finally got around to writing up a simple approach I’ve been using for REST-style view functions in Django that dispatch based on request.method.
I wrote something similar a while back. The proof of concept was still on my hard disc: http://dpaste.com/hold/79655/
As you see you can use __new__ to return a function. This way you would not have to import and instantiate the class in urls.py.
Henning - 22nd September 2008 02:00 - #