12345678910111213141516 |
- from django.contrib.auth.models import User
- from rest_framework import serializers
- from django.contrib.auth.models import User
- from .models import UserProfile
- class UserSerializer(serializers.ModelSerializer):
- class Meta:
- model = User
- fields = ['id', 'username', 'first_name', 'last_name','email']
- class UserProfileSerializer(serializers.ModelSerializer):
- model = UserProfile
- fields = ['name']
|