Saturday, October 27, 2018

Re: Django auto-deletes field related to MySQL Transactions

Thanks for the info. Do you know of a way that I can confirm this is happening?

Best,
- Ryan

On Thursday, October 25, 2018 at 8:37:35 AM UTC-5, C. Kirby wrote:
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/aa944f18-69b0-4734-9833-0ec88dd9acee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment