While it’s possible to use on_delete when using a through model, it would be convenient to be able to do so without needing to define a though model.
This is especially applicable for existing projects, where on_delete=CASCADE has become undesirable, and migrating to a through model may be a challenge due to existing data.
Looking into this, it appears it would be fairly easily achieved by modifying create_many_to_many_intermediary_model and ManyToManyField.init and adding to_on_delete and from_on_delete, which could default to CASCADE to preserve current behavior.
I think only CASCADE, PROTECT and RESTRICT would make sense, so an exception could be raised if either a through model is provided, or if SET_NULL, SET_DEFAULT or DO_NOTHING is used.
I’d love to hear your thoughts.