On Thu, Jun 10, 2010 at 2:53 PM, Thomas Guettler <h...@tbz-pariv.de> wrote: > The documentation says django emulates "ON DELETE CASCADE": > http://docs.djangoproject.com/en/dev/topics/db/queries/#deleting-objects > > But it is missing how to emulate ON DELETE SET NULL. > > In this thread Kevin Howerton posted an abstract base class to emulate ON > DELETE SET NULL. But this does not work if you bulk delete with a query set. > > I opened a new ticket: > > http://code.djangoproject.com/ticket/13731
Kevin's abstract base class is certainly a novel way of solving the problem (mod the issues with bulk delete). However, the real fix is to add first-class support for alternate deletion strategies. This is the subject of #7539. If someone wants to take on #7539 as a task for 1.3, they certainly have my blessing, and I'd certainly do anything I can to help. It's been on the low priority list for the last couple of releases, and on my personal to-do for much longer. The last time I looked at the patch, it was starting to look reasonably good. However, it's not finished yet -- it really needs someone who is suitably motivated to carry it the final mile. In the interim, I'm not in favor of adding a 'workaround' solution as part of Django's official documentation. This sort of workaround is something that should live on Django Snippets. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.