example-of-crud-in-django-w.../app/libros/serializers.py

16 lines
324 B
Python
Raw Normal View History

2021-07-09 19:09:31 +02:00
# app/libros/serializers.py
from rest_framework import serializers
from .models import Libros
class LibroSerializer(serializers.ModelSerializer):
class Meta:
model = Libros
fields = "__all__"
read_only_fields = (
"id",
2021-07-13 18:18:18 +02:00
"created_at",
"updated_at",
2021-07-09 19:09:31 +02:00
)