Created
July 22, 2019 20:12
-
-
Save akshar-raaj/d593e9a432920251197ca580df9f128c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserSerializer(serializers.ModelSerializer): | |
| first_name = serializers.SerializerMethodField() | |
| def get_first_name(self, obj): | |
| return obj.first_name.title() | |
| class Meta: | |
| model = User | |
| fields = ('email', 'first_name', 'last_name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment