thanks a lot!

i'll try Matts solution, it's exactly what i wanted to do,
using jquery to send an $.ajax request with method DELETE and id of
the object to delete
in the url params...



On Jun 14, 5:01 pm, Matt Hoskins <[email protected]> wrote:
> From glancing at the code for the modpython and wsgi core handlers I
> think django always puts the URL arguments into "request.GET"
> regardless of method (i.e. it's not restricted to just GET and POST
> requests, since query strings on URLs can exist for any method) where
> as "request.POST" will only be populated from a POST.
>
> So you would do:
> if request.method=='DELETE':
>   MyModel.objects.get(id=request.GET['id']).delete()
>
> (assuming, based on your code, that your client software is genuinely
> doing an HTTP DELETE request and that you have an id in the query
> string part of the URL)
>
> On Jun 14, 10:48 am, kalinski <[email protected]> wrote:
>
>
>
> > Hi Djangos,
>
> > is this working like expected with recent django version:?
>
> > def myview(request):
> >    if request.is_ajax:
> >       if request.DELETE #or alternatively if request.method=='DELETE':
> >          MyModel.objects.get(id=request.DELETE['id']).delete()
>
> > or do i have to go through POST and for example hidden form fields?
>
> > thanks
> > kalinski

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

Reply via email to