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