from rest_framework import serializers
from .models import Book, BookNumber, Character, Author


class BookNumberSerializzer(serializers.ModelSerializer):


    class Meta:
        model = BookNumber
        fields = ['isbn_10', 'isbn_13', 'id']


class CharacterSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Character
        fields = ['id', 'name']


class AuthorSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['id', 'name', 'surname']


class BookSerializer(serializers.ModelSerializer):
    number = BookNumberSerializzer(many=False)
    characters = CharacterSerializzer(many=True)
    authors = AuthorSerializzer(many=True)


    class Meta:
        model = Book
        fields = ['id', 'title', 'description', 'price', 'number',
            'characters', 'authors']


class BookMiniSerializer(serializers.ModelSerializer):


    class Meta:
        model = Book
        fields = ['id', 'title']

8381f29347eb67e5898fbf9b0fb7dafd7c00f044
<mask token>


class AuthorSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['id', 'name', 'surname']


class BookSerializer(serializers.ModelSerializer):
    number = BookNumberSerializzer(many=False)
    characters = CharacterSerializzer(many=True)
    authors = AuthorSerializzer(many=True)


    class Meta:
        model = Book
        fields = ['id', 'title', 'description', 'price', 'number',
            'characters', 'authors']


class BookMiniSerializer(serializers.ModelSerializer):


    class Meta:
        model = Book
        fields = ['id', 'title']

<mask token>


class CharacterSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Character
        fields = ['id', 'name']


class AuthorSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['id', 'name', 'surname']


class BookSerializer(serializers.ModelSerializer):
    number = BookNumberSerializzer(many=False)
    characters = CharacterSerializzer(many=True)
    authors = AuthorSerializzer(many=True)


    class Meta:
        model = Book
        fields = ['id', 'title', 'description', 'price', 'number',
            'characters', 'authors']


class BookMiniSerializer(serializers.ModelSerializer):


    class Meta:
        model = Book
        fields = ['id', 'title']

<mask token>


class BookNumberSerializzer(serializers.ModelSerializer):


    class Meta:
        model = BookNumber
        fields = ['isbn_10', 'isbn_13', 'id']


class CharacterSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Character
        fields = ['id', 'name']


class AuthorSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['id', 'name', 'surname']


class BookSerializer(serializers.ModelSerializer):
    number = BookNumberSerializzer(many=False)
    characters = CharacterSerializzer(many=True)
    authors = AuthorSerializzer(many=True)


    class Meta:
        model = Book
        fields = ['id', 'title', 'description', 'price', 'number',
            'characters', 'authors']


class BookMiniSerializer(serializers.ModelSerializer):


    class Meta:
        model = Book
        fields = ['id', 'title']

from rest_framework import serializers
from .models import Book, BookNumber, Character, Author


class BookNumberSerializzer(serializers.ModelSerializer):


    class Meta:
        model = BookNumber
        fields = ['isbn_10', 'isbn_13', 'id']


class CharacterSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Character
        fields = ['id', 'name']


class AuthorSerializzer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['id', 'name', 'surname']


class BookSerializer(serializers.ModelSerializer):
    number = BookNumberSerializzer(many=False)
    characters = CharacterSerializzer(many=True)
    authors = AuthorSerializzer(many=True)


    class Meta:
        model = Book
        fields = ['id', 'title', 'description', 'price', 'number',
            'characters', 'authors']


class BookMiniSerializer(serializers.ModelSerializer):


    class Meta:
        model = Book
        fields = ['id', 'title']
