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.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store