Hi Carl, Thanks for the reply. My guess is that adding a new, optional Meta argument, (e.g. ``call_delete_on_fk_delete = True``) would be much simpler to implement. I used ``on_delete`` to make it easy to understand what I'm asking for, though if it is possible to achieve this way, I'd be willing to work in that direction.
On Dec 5, 8:58 am, Carl Meyer <c...@oddbird.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 12/05/2011 08:31 AM, Yo-Yo Ma wrote: > > > While I agree that signals allow for neat decoupling, they aren't as > > DRY or quick as a simple field kwarg. Imagine you have 8 models that > > have custom delete methods. Which is easier: A) avstracting the > > functionality of each of the 8 delete methods into helper functions > > and writing signals for all 8, or B) typing on_delete=CALL_DELETE? How > > will this question be answered, objectively? > > Clearly the latter. But "what is easier to type" is not, of course, the > only relevant consideration. A couple notes: > > 1. Implementing the proposed on_delete handler would require a major > reworking of how on_delete handlers function. Currently, they allow for > modifying the list of objects to be deleted, but not changing how the > delete actually happens. To make the latter possible, while still doing > things correctly w.r.t. deletion ordering in the presence of FKs, etc, > would be far from a trivial patch. > > 2. The proposal would have abysmal performance characteristics on a > large delete. Thus, it would have to come with big red warnings in the > docs. I'm generally averse to adding features that require big red > warnings in the docs. > > Carl > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ > > iEYEARECAAYFAk7c6ioACgkQ8W4rlRKtE2d2mgCgq0bOAHbMj4b9qbAeeeTi9VUx > PFYAoNiYP5+g9r/EbNiy6qj17oKlPmfP > =TblP > -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@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.