from rest_framework import serializers, permissions

from order.models import Order


class OrderSerializer(serializers.ModelSerializer):
    name = serializers.ReadOnlyField(source='user.username')
    email = serializers.ReadOnlyField(source='user.email')
    permission_classes = (permissions.IsAuthenticated,)

    class Meta:
        model = Order
        fields = ('size', 'name', 'email')

3724ac8d299e3ede8d9f39a7d08da741e816be84
<mask token>

<mask token>


class OrderSerializer(serializers.ModelSerializer):
    <mask token>
    <mask token>
    <mask token>


    class Meta:
        model = Order
        fields = 'size', 'name', 'email'

<mask token>


class OrderSerializer(serializers.ModelSerializer):
    name = serializers.ReadOnlyField(source='user.username')
    email = serializers.ReadOnlyField(source='user.email')
    permission_classes = permissions.IsAuthenticated,


    class Meta:
        model = Order
        fields = 'size', 'name', 'email'

from rest_framework import serializers, permissions
from order.models import Order


class OrderSerializer(serializers.ModelSerializer):
    name = serializers.ReadOnlyField(source='user.username')
    email = serializers.ReadOnlyField(source='user.email')
    permission_classes = permissions.IsAuthenticated,


    class Meta:
        model = Order
        fields = 'size', 'name', 'email'

from rest_framework import serializers, permissions

from order.models import Order


class OrderSerializer(serializers.ModelSerializer):
    name = serializers.ReadOnlyField(source='user.username')
    email = serializers.ReadOnlyField(source='user.email')
    permission_classes = (permissions.IsAuthenticated,)

    class Meta:
        model = Order
        fields = ('size', 'name', 'email')
