From 4fa515980280aeffcfaab48d7dfa63fbd018c90f Mon Sep 17 00:00:00 2001 From: Vladyslav Timofieiev Date: Sat, 23 Nov 2024 22:11:10 +0200 Subject: [PATCH] Add Author model fields to AuthorSerializer - Imported the Author model into serializers and implemented the AuthorSerializer. --- author/serializers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/author/serializers.py b/author/serializers.py index d286b95..79e0b03 100644 --- a/author/serializers.py +++ b/author/serializers.py @@ -1,6 +1,9 @@ from rest_framework import serializers +from author.models import Author + class AuthorSerializer(serializers.ModelSerializer): - # write your code here - pass + class Meta: + model = Author + fields = ["first_name", "last_name", "pseudonym", "age", "retired"]