I was looking at examples using 'raise ValidationError' but I don't want to raise an error based on the value of something. I always want the user to be prompted with a "Are you sure you want to save this?" every time they hit "save" :
if request.method == 'POST':
form = LocationForm(request.POST, instance=l)
if form.is_valid():
#prompt user first yes_no = confrim('Are you sure you want to save this thing into the database?')
form.save() #only if yes_no is true.
So if the form is valid the user should be prompted with a "Are you sure?" message, and if yes was clicked, then save the form.
What would be the easiest and most correct way to do this in django?
Thanks in advance
--
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
http://groups.google.com/group/django-users?hl=en.
For more options, visit
https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home