The delete method in your views, yes, but also how you build the button.
You should use a form with a hidden field (the id to delete), and the
button ("Delete") should be the form submit. Then on the view side you
should use a standard form handler (if request.POST....etc) to handle
things. What is probably happening is the browser is automatically
following the <a> tag to do prefetching, and causing the record to delete.
Browsers will not prefetch "POST" verbs (so, a form post)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/68ba9ea5-0ce3-445d-ab08-04053d1720ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.