legacy/pairent_backend/pairent_app/serializer.py

19 lines
429 B
Python

from rest_framework import serializers
from .models import Apartament
class ApartamentListSerializer(serializers.ModelSerializer):
"""Список всех квартиры"""
class Meta:
model = Apartament
exclude = ("views",)
class ApartamentDetailSerializer(serializers.ModelSerializer):
"""Вывод квартиры"""
class Meta:
model = Apartament
fields = "__all__"