def process(self, obj): set_defaults(obj, **self.get_excluded_field_defaults()) obj = self.save() defaults = self.get_excluded_m2m_field_defaults() for key, values in defaults: manager = getattr(obj, key) manager.set(values, clear=True) return obj