Skip to content

Commit

Permalink
created groups
Browse files Browse the repository at this point in the history
  • Loading branch information
walosha committed Jan 21, 2023
1 parent 6bdcca7 commit 835a484
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions siteinfo/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from .models import Post, Comment
from .serializers import PostSerializer, CommentSerializer
from rest_framework import generics
# from django.db.models import Count


class PostCreateAPIView(generics.CreateAPIView):
queryset = Post.objects.all()
serializer_class = PostSerializer


class PostListAPIView(generics.ListAPIView):
queryset = Post.objects.all()
serializer_class = PostSerializer


class PostRetrieveAPIView(generics.RetrieveAPIView):

queryset = Post.objects.all()
serializer_class = PostSerializer


class PostUpdateAPIView(generics.UpdateAPIView):
queryset = Post.objects.all()
serializer_class = PostSerializer


class PostDestroyAPIView(generics.DestroyAPIView):
queryset = Post.objects.all()
serializer_class = PostSerializer

0 comments on commit 835a484

Please sign in to comment.