On Fri, 2007-10-05 at 16:17 +0300, Peter Nixon wrote:
> On Thu 04 Oct 2007, Malcolm Tredinnick wrote:
> > On Thu, 2007-10-04 at 18:10 +0300, Peter Nixon wrote:
> > > I tried to open the following ticket but it thinks my IP is a spammer,
> > > so I am sending to the list:
> > >
> > > http://django-rest-interface.googlecode.com/svn/trunk/django_restapi/res
> > >ource.py tries to set "request.method = 'POST'" in order to run PUTs
> > > through request._load_post_and_files() as POSTs as
> > > _load_post_and_files() does not currently seem to support PUT. This used
> > > to work, however current django SVN seems to have broken it. This
> > > breakage seems to be by design as the HttpRequest doc says "All
> > > attributes except session should be considered read-only." I am not the
> > > author of django-rest-interface but I am using it in production.
> > >
> > > Can request._load_post_and_files() be updated to support PUT also in
> > > order to fix this issue??
> >
> > The current django-rest-interface approach was a bit of a hack that
> > turned out to pretty well so that we didn't need to change core at the
> > time. We should get around to adding PUT support to HttpRequest, though,
> > you're right.
> >
> > I've created ticket #5682 for this. It's a really trivial change (you've
> > seen how simple it is in django-rest-interface), so shouldn't take too
> > long to fix.
> 
> Hi Malcolm
> 
> Aside from the BIGINT patch (which still hasn't been applied) I haven't done 
> much hacking on Django internals so it is not so trivial for me. :-)
> 
> I have been reading through ModPythonRequest, HttpRequest and 
> http://www.b-list.org/weblog/2006/jun/13/how-django-processes-request/ and 
> think I have almost got a handle on it. Do you think you will have a chance 
> to look at this soon or should I try to patch it myself? 

I would encourage you to try it yourself.

It shouldn't be too hard.. let me point you at the right place. Have a
look in django/core/handlers/*.py for where we set up the GET and POST
properties (wsgi.py and modpython.py). It should be as simple as
creating an analogous thing for PUT and then altering the call to
_load_post_and_files so that it only populates POST or PUT when the
method is appropriate.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to