from location import models
from location.serializers import common
from utils.serializers import TranslatedField


class AddressCreateSerializer(common.AddressDetailSerializer):
    """Address create serializer."""


class CountryBackSerializer(common.CountrySerializer):
    """Country back-office serializer."""

    name_translated = TranslatedField()

    class Meta:
        model = models.Country
        fields = [
            'id',
            'code',
            'svg_image',
            'name',
            'name_translated',
            'display_calling_code',
            'default_calling_code',
        ]
        extra_kwargs = {
            'calling_code': {'write_only': True}
        }
