20 lines
549 B
Python
20 lines
549 B
Python
from django.utils.translation import gettext_lazy
|
|
from rest_framework import serializers
|
|
|
|
from ncircc.models.comments import Comment
|
|
|
|
|
|
class CommentRetrieveSerializer(serializers.ModelSerializer):
|
|
"""Serializer for retrieve"""
|
|
|
|
class Meta:
|
|
model = Comment
|
|
fields = ('id', 'text', 'create_time', 'login', 'notification', 'id_in_ncircc', 'from_console', 'is_read')
|
|
|
|
|
|
class CommentCreateSerializer(serializers.ModelSerializer):
|
|
"""Serializer for create"""
|
|
|
|
class Meta:
|
|
model = Comment
|
|
fields = ('text',)
|