2023-05-01 12:39:34 +02:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
2023-05-12 14:10:12 +02:00
|
|
|
from .models import Apartament, User
|
2023-05-01 12:39:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ApartamentListSerializer(serializers.ModelSerializer):
|
|
|
|
"""Список всех квартиры"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Apartament
|
|
|
|
exclude = ("views",)
|
|
|
|
|
|
|
|
|
|
|
|
class ApartamentDetailSerializer(serializers.ModelSerializer):
|
|
|
|
"""Вывод квартиры"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Apartament
|
2023-05-12 14:10:12 +02:00
|
|
|
fields = "__all__"
|
|
|
|
|
|
|
|
class PsychTestAddResultSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = User
|
|
|
|
fields = "psych_test_result"
|