dealertrack / django-rest-framework-braces

Collection of utilities for working with django rest framework (DRF)
Other
73 stars 20 forks source link

NotImplementedError ** does not currently serialize Form --> JSON #22

Open Guilouf opened 5 years ago

Guilouf commented 5 years ago

Hello, i have a modelForm, like this:

class PhotographyAPIForm(forms.ModelForm):
    class Meta:
        model = Photography
        fields = '__all__'

And i wanted to 'convert' this form to a serializer:

class PhotoSerializer(FormSerializer):
    class Meta:
        form = PhotographyAPIForm

Access it via a viewset:

class PhotoViewSet(viewsets.ModelViewSet):
    queryset = Photography.objects.all()
    serializer_class = PhotoSerializer

I'm using django-rest-framework-braces-0.2.3, DRF 3 and Django 2, and i receive this error:

NotImplementedError at /gabarit/api/photos/
PhotoSerializer does not currently serialize Form --> JSON
SebCorbin commented 3 years ago

It seems there is the same issue for SerializerForm, which cannot handle model serializers as well, see https://github.com/dealertrack/django-rest-framework-braces/issues/20