from rest_framework import serializers
from .models import CommentList_blog,CommentList_suibi
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.pagination import PageNumberPagination
from datetime import datetime

#分页设置类继承
class pagenationset(PageNumberPagination):
    page_size = 5
    page_query_param = 'pageIndex'
    page_size_query_param = 'pageSize'
    max_page_size = 10

class CommentList1_serializer(serializers.ModelSerializer):
    class Meta:
        model = CommentList_blog
        fields = '__all__'

class CommentList2_serializer(serializers.ModelSerializer):
    class Meta:
        model = CommentList_suibi
        fields = '__all__'


@api_view(['POST'])
def CommentListViewSet(request):
    pass
    """
    name = request.POST['name']
    email = request.POST['email']
    content = request.POST['content']
    id = request.POST['id']
    obj = {
        name = name,
        email = email,
        content = content,
        add_time = datetime.datetime.now()
        comment_obj = id
    }
    obj.save()
    """
   
        

    

055a4d79289639f326d3f1b3a48c029f1628f1fb
<mask token>


class CommentList1_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_blog
        fields = '__all__'


class CommentList2_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_suibi
        fields = '__all__'


<mask token>

<mask token>


class pagenationset(PageNumberPagination):
    page_size = 5
    page_query_param = 'pageIndex'
    page_size_query_param = 'pageSize'
    max_page_size = 10


class CommentList1_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_blog
        fields = '__all__'


class CommentList2_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_suibi
        fields = '__all__'


<mask token>

<mask token>


class pagenationset(PageNumberPagination):
    page_size = 5
    page_query_param = 'pageIndex'
    page_size_query_param = 'pageSize'
    max_page_size = 10


class CommentList1_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_blog
        fields = '__all__'


class CommentList2_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_suibi
        fields = '__all__'


@api_view(['POST'])
def CommentListViewSet(request):
    pass
    """
    name = request.POST['name']
    email = request.POST['email']
    content = request.POST['content']
    id = request.POST['id']
    obj = {
        name = name,
        email = email,
        content = content,
        add_time = datetime.datetime.now()
        comment_obj = id
    }
    obj.save()
    """

from rest_framework import serializers
from .models import CommentList_blog, CommentList_suibi
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.pagination import PageNumberPagination
from datetime import datetime


class pagenationset(PageNumberPagination):
    page_size = 5
    page_query_param = 'pageIndex'
    page_size_query_param = 'pageSize'
    max_page_size = 10


class CommentList1_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_blog
        fields = '__all__'


class CommentList2_serializer(serializers.ModelSerializer):


    class Meta:
        model = CommentList_suibi
        fields = '__all__'


@api_view(['POST'])
def CommentListViewSet(request):
    pass
    """
    name = request.POST['name']
    email = request.POST['email']
    content = request.POST['content']
    id = request.POST['id']
    obj = {
        name = name,
        email = email,
        content = content,
        add_time = datetime.datetime.now()
        comment_obj = id
    }
    obj.save()
    """

from rest_framework import serializers
from .models import CommentList_blog,CommentList_suibi
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.pagination import PageNumberPagination
from datetime import datetime

#分页设置类继承
class pagenationset(PageNumberPagination):
    page_size = 5
    page_query_param = 'pageIndex'
    page_size_query_param = 'pageSize'
    max_page_size = 10

class CommentList1_serializer(serializers.ModelSerializer):
    class Meta:
        model = CommentList_blog
        fields = '__all__'

class CommentList2_serializer(serializers.ModelSerializer):
    class Meta:
        model = CommentList_suibi
        fields = '__all__'


@api_view(['POST'])
def CommentListViewSet(request):
    pass
    """
    name = request.POST['name']
    email = request.POST['email']
    content = request.POST['content']
    id = request.POST['id']
    obj = {
        name = name,
        email = email,
        content = content,
        add_time = datetime.datetime.now()
        comment_obj = id
    }
    obj.save()
    """
   
        

    
