from rest_framework import serializers
from subscriptions.models import Profile, SalesPersons


class ProfileSerializers(serializers.ModelSerializer):
    class Meta:
        model = Profile
        fields = '__all__'


class SalesPersonsSerializers(serializers.ModelSerializer):
    profiles_name = serializers.SerializerMethodField()

    class Meta:
        model = SalesPersons
        fields = '__all__'

    def get_profiles_name(self, obj):
        return obj.profiles.name
