from rest_framework import serializers
from .models import Post
from User.serializers import SimplifiedUserSerializer, CommentSerializer

# Serializers


class PostSerializer(serializers.ModelSerializer):
    comments = CommentSerializer(many=True, read_only=True)
    user = SimplifiedUserSerializer(many=False, read_only=True)

    class Meta:
        model = Post
        fields = '__all__'
