Skip to content

Instantly share code, notes, and snippets.

@brunomichetti
Created July 1, 2022 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunomichetti/b19356eb513c2938bc20c852dca0d401 to your computer and use it in GitHub Desktop.
Save brunomichetti/b19356eb513c2938bc20c852dca0d401 to your computer and use it in GitHub Desktop.
# serializers.py in the users Django app
...
from users.models import CustomUser
...
class CustomUserDetailsSerializer(serializers.ModelSerializer):
class Meta:
model = CustomUser
fields = (
'pk',
'email',
'phone_number',
'gender',
)
read_only_fields = ('pk', 'email', 'phone_number',)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment