On Sep 21, 2017 2:39 AM, "Rakhee Menon" <menonrakhe...@gmail.com> wrote:

Hello Everyone ,
Can anyone tell me how to write views where, when clicked  on delete button
the data shouldn't get deleted only the flag should turn 0

Just use a standard update view that toggles the field that you are using
for the object status. You can make the buttons on the form say whatever
you'd like.

I would also recommend overriding the default model manager to
automatically exclude objects that have been "deleted" if that makes sense
for your project. Otherwise you'll need to remember to exclude those
deleted objects manually everywhere.

-James

-- 
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+unsubscr...@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/CA%2Be%2BciUeGBBavZGBdKcRu_Kssk47Rkwp2q%2BsUTKydXk3iMepeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to