blob: 0929e79884b3d83b9681d8149299b70ab4b9fc07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from rest_framework import serializers
from taggit_serializer.serializers import TagListSerializerField, TaggitSerializer
from .models import Note, Folder
class NoteSerializer(TaggitSerializer, serializers.HyperlinkedModelSerializer):
tags = TagListSerializerField()
class Meta:
model = Note
fields = ('title', 'body', 'url', 'tags')
class FolderSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Folder
fields = ('name',)
|