Created
July 22, 2019 20:14
-
-
Save akshar-raaj/577f68ce2c3a88be616edae1339124ac 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): | |
| full_name = serializers.SerializerMethodField() | |
| def get_full_name(self, obj): | |
| return obj.get_full_name().upper() | |
| class Meta: | |
| model = User | |
| fields = ('email', 'first_name', 'last_name', 'full_name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment