<filename>django_test/articles/api_views.py<gh_stars>0
from .models import Tag, Article
from .serializer import TagSerializer, ArticleSerializer
from rest_framework import viewsets


class TagViewSet(viewsets.ModelViewSet):
    queryset = Tag.objects.all()
    serializer_class = TagSerializer


class ArticleViewSet(viewsets.ModelViewSet):
    queryset = Article.objects.all()
    serializer_class = ArticleSerializer
<filename>django_test/articles/api_views.py<gh_stars>0
from .models import Tag, Article
from .serializer import TagSerializer, ArticleSerializer
from rest_framework import viewsets


class TagViewSet(viewsets.ModelViewSet):
    queryset = Tag.objects.all()
    serializer_class = TagSerializer


class ArticleViewSet(viewsets.ModelViewSet):
    queryset = Article.objects.all()
    serializer_class = ArticleSerializer