[Answered ]-How do you delete all manytomany relationships in a model in form_valid?

1👍

To remove all objects from the related object, use clear() (Django Docs) method:

form.instance.participants.clear()

Note that add(), create(), remove(), clear(), and set() all
apply database changes immediately for all types of related fields. In
other words, there is no need to call save() on either end of the
relationship.

👤NKSM

Leave a comment