ManyToManyField in Class Based Generic Views and Save Override
问题 We have a class-based-generic view that adds an object with a ManyToManyField relationship. We're trying to modify some values on save() override for the relationships created on that ManyToManyField, but it doesn't seem like they ever get created in save(), so we're forced to call a post_save method in get_success_url so the relationships are created. This seems very, very ugly. How do we force the relationships to be created before we leave save()? I've seen this answer on SO, which says to