# Path: jellyblog/models.py
# class Note(models.Model):
#     # 노트 Model
#     def __str__(self):
#         return self.content
# 
#     id = models.AutoField(primary_key=True)
#     content = models.CharField(max_length=300)
#     time = models.DateTimeField(auto_now_add=True)
#     update_time = models.DateTimeField(auto_now=True)


from .models import Note
from rest_framework import serializers, viewsets, routers


class NoteSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Note
        fields = ('id', 'content', 'time', 'update_time')


class NoteViewSet(viewsets.ReadOnlyModelViewSet):

# Path: jellyblog/models.py
# class Note(models.Model):
#     # 노트 Model
#     def __str__(self):
#         return self.content
# 
#     id = models.AutoField(primary_key=True)
#     content = models.CharField(max_length=300)
#     time = models.DateTimeField(auto_now_add=True)
#     update_time = models.DateTimeField(auto_now=True)


# Path: jellyblog/serializer.py
from .models import Note
from rest_framework import serializers, viewsets, routers



class NoteSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Note
        fields = ('id', 'content', 'time', 'update_time')


class NoteViewSet(viewsets.ReadOnlyModelViewSet):

    queryset = Note.objects.all()