LeeHanYeong/django-quill-editor

Integrate with Django Rest Framework

Enzodtz opened this issue · 3 comments

Hey!

I was trying to use the editor with DRF, but when DRF serializes the field, it just calls str method, which returns that default python str for classes. If we instead return the delta, it will be possible to integrate with the serializer just fine.

I will open a PR to do so.

PR Opened: #99

What's the status on this, I need to use the QuillField in my App via an API but there seems to be no easy way to achieve this out of the box.

@scroogeT i had to override the to_representation method of rest framework serializer class to get instance.content.delta like so.

def to_representation(self, instance):
        resp = super().to_representation(instance)
        resp["content"] = instance.content.delta
        return resp

content is the atrribute with quill field...