Created
July 22, 2019 19:16
-
-
Save akshar-raaj/1c0f3bcb8a2b78f3a17bdad1179bce2d to your computer and use it in GitHub Desktop.
Effective serializer for read
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
| from rest_framework import serializers | |
| from django.contrib.auth.models import User | |
| class UserSerializer(serializers.ModelSerializer): | |
| class Meta: | |
| model = User | |
| fields = ('username', 'email', 'first_name', 'last_name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment