--

Hi Clement,

I wouldn't use Django REST Framework with Flask. I'd probably pick a serializer like `marshmallow` if I needed model serialization.

In marshmallow, you can add a `fields.Method('my_method')` to your serializer that will call your custom logic.

Of course, if you just need custom logic and no model serialization, you can skip `marshmallow` altogether and just write custom code that returns a `JsonResponse` in your view.

--

--

Bennett Garner
Bennett Garner

Written by Bennett Garner

DeveloperPurpose.com — Build a coding career with meaning and purpose 💻 Top writer in technology ✍️

No responses yet