from catalogo.models import Author
from django.forms import fields
from catalogo.models import Book
from rest_framework import serializers


class AuthorSerializer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['first_name', 'last_name', 'nationality', 'genere']


class BookSerializer(serializers.ModelSerializer):
    author = AuthorSerializer()


    class Meta:
        model = Book
        fields = ['title', 'editorial', 'year', 'volumen', 'author']

9aa1c68a9d47360971d114ae865bd280d629f186
<mask token>


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


    class Meta:
        model = Book
        fields = ['title', 'editorial', 'year', 'volumen', 'author']

<mask token>


class BookSerializer(serializers.ModelSerializer):
    author = AuthorSerializer()


    class Meta:
        model = Book
        fields = ['title', 'editorial', 'year', 'volumen', 'author']

<mask token>


class AuthorSerializer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['first_name', 'last_name', 'nationality', 'genere']


class BookSerializer(serializers.ModelSerializer):
    author = AuthorSerializer()


    class Meta:
        model = Book
        fields = ['title', 'editorial', 'year', 'volumen', 'author']

from catalogo.models import Author
from django.forms import fields
from catalogo.models import Book
from rest_framework import serializers


class AuthorSerializer(serializers.ModelSerializer):


    class Meta:
        model = Author
        fields = ['first_name', 'last_name', 'nationality', 'genere']


class BookSerializer(serializers.ModelSerializer):
    author = AuthorSerializer()


    class Meta:
        model = Book
        fields = ['title', 'editorial', 'year', 'volumen', 'author']
