from rest_framework import serializers

from core.models import DirectMessage, Chat


class DirectMessageSerializer(serializers.ModelSerializer):
    """Serializing messages between users"""
    class Meta:
        model = DirectMessage
        fields = ('sender', 'reciever', 'text', 'datetime')

        read_only_fields = ('sender',)

    
class ChatSerializer(serializers.ModelSerializer):

    class Meta:
        model = Chat
        fields = ('interactors',)


c9600186138be59686234dae1ff5c68d7f9cb0a5
<mask token>


class ChatSerializer(serializers.ModelSerializer):


    class Meta:
        model = Chat
        fields = 'interactors',

<mask token>


class DirectMessageSerializer(serializers.ModelSerializer):
    <mask token>


    class Meta:
        model = DirectMessage
        fields = 'sender', 'reciever', 'text', 'datetime'
        read_only_fields = 'sender',


class ChatSerializer(serializers.ModelSerializer):


    class Meta:
        model = Chat
        fields = 'interactors',

<mask token>


class DirectMessageSerializer(serializers.ModelSerializer):
    """Serializing messages between users"""


    class Meta:
        model = DirectMessage
        fields = 'sender', 'reciever', 'text', 'datetime'
        read_only_fields = 'sender',


class ChatSerializer(serializers.ModelSerializer):


    class Meta:
        model = Chat
        fields = 'interactors',

from rest_framework import serializers
from core.models import DirectMessage, Chat


class DirectMessageSerializer(serializers.ModelSerializer):
    """Serializing messages between users"""


    class Meta:
        model = DirectMessage
        fields = 'sender', 'reciever', 'text', 'datetime'
        read_only_fields = 'sender',


class ChatSerializer(serializers.ModelSerializer):


    class Meta:
        model = Chat
        fields = 'interactors',

from rest_framework import serializers

from core.models import DirectMessage, Chat


class DirectMessageSerializer(serializers.ModelSerializer):
    """Serializing messages between users"""
    class Meta:
        model = DirectMessage
        fields = ('sender', 'reciever', 'text', 'datetime')

        read_only_fields = ('sender',)

    
class ChatSerializer(serializers.ModelSerializer):

    class Meta:
        model = Chat
        fields = ('interactors',)

