[Fixed]-Django Rest Framework. SerializerMethodField or source?

1👍

✅

There are no difference between them. If you want to improve speed you should do it in a view by calling select_related method of a queryset.

YourModel.objects.select_related('user')

It’ll join user table and calling user.name atribute will not hit a database next time

0👍

First one provides different validation options from the box. While the second one is something very customizable and doesn’t provide any validation itself.

Leave a comment