example-of-crud-in-django-w.../app/library/serializers.py
2021-07-14 16:19:03 +02:00

16 lines
320 B
Python

# app/Library/serializers.py
from rest_framework import serializers
from .models import Book
class BookSerializer(serializers.ModelSerializer):
class Meta:
model = Book
fields = "__all__"
read_only_fields = (
"id",
"created_at",
"updated_at",
)