from django.contrib.auth.models import User
from rest_framework import serializers

from forum.models import ForumPost, ForumPostAnswer


class ForumPostSerializer(serializers.ModelSerializer):
    # user = serializers.ReadOnlyField(source='user.username')

    class Meta:
        model = ForumPost
        fields = ['id', 'title', 'description', 'user']


class ForumPostAnswerSerializer(serializers.ModelSerializer):
    # user = serializers.ReadOnlyField(source='user.username')

    class Meta:
        model = ForumPostAnswer
        fields = ['id', 'description', 'forumpost', 'user']


2ab14cc25386df90156794bca34ddf415de86194
<mask token>

<mask token>


class ForumPostAnswerSerializer(serializers.ModelSerializer):


    class Meta:
        model = ForumPostAnswer
        fields = ['id', 'description', 'forumpost', 'user']

<mask token>


class ForumPostSerializer(serializers.ModelSerializer):


    class Meta:
        model = ForumPost
        fields = ['id', 'title', 'description', 'user']


class ForumPostAnswerSerializer(serializers.ModelSerializer):


    class Meta:
        model = ForumPostAnswer
        fields = ['id', 'description', 'forumpost', 'user']

from django.contrib.auth.models import User
from rest_framework import serializers
from forum.models import ForumPost, ForumPostAnswer


class ForumPostSerializer(serializers.ModelSerializer):


    class Meta:
        model = ForumPost
        fields = ['id', 'title', 'description', 'user']


class ForumPostAnswerSerializer(serializers.ModelSerializer):


    class Meta:
        model = ForumPostAnswer
        fields = ['id', 'description', 'forumpost', 'user']

from django.contrib.auth.models import User
from rest_framework import serializers

from forum.models import ForumPost, ForumPostAnswer


class ForumPostSerializer(serializers.ModelSerializer):
    # user = serializers.ReadOnlyField(source='user.username')

    class Meta:
        model = ForumPost
        fields = ['id', 'title', 'description', 'user']


class ForumPostAnswerSerializer(serializers.ModelSerializer):
    # user = serializers.ReadOnlyField(source='user.username')

    class Meta:
        model = ForumPostAnswer
        fields = ['id', 'description', 'forumpost', 'user']

