2010/8/13 Nick Serra <nickse...@gmail.com> > Look into the clear() method on many to many relations. > Calling .clear() before a delete will remove all relations between the > models and allow you to delete the category only. You might be > fighting the django admin on this though, so this would be best > implemented in a custom solution. Not sure if you could override > delete and call the clear() function, this may trick the admin into > keeping the related objects, or maybe do something in a pre_delete > signal. Check out the clear function here: > > http://docs.djangoproject.com/en/dev/topics/db/queries/#following-relationships-backward > > Thank you for your hint, I solved by following this :
stackoverflow.com/questions/1471909/django-model-delete-not-triggered I lost the confirmation page but I can live without it. I also tried with pre_delete signal but raising an exception will display 500 error page and I couldn't find a way to redisplay the change_list template with a nice message. -- Alessandro Pasotti w3: www.itopen.it -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.