I am using the Django REST Framework and I have a serializer as follows:
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
depth = 1
fields = ['user','team','correct','wrong','percentage']
The problem if this passes all user data (including a hashed password). How do I limit the fields being passed?
I have a UserSerializer as follows (which holds the only fields I really want):
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ['first_name','last_name','username']