I have two models, one with M2M relation and a related name. I want to include all fields in the serializer and the related field.
models.py:
This is how i did it, much more easier
class OperativeForm(forms.ModelForm): class Meta: model = Operative fields = '__all__' exclude = ('name','objective',) widgets = {'__all__':'required'}