12 lines
372 B
Python
12 lines
372 B
Python
from .models import Snippet
|
|
from .serializers import SnippetSerializer
|
|
from rest_framework import generics
|
|
|
|
class SnippetList(generics.ListCreateAPIView):
|
|
queryset = Snippet.objects.all()
|
|
serializer_class = SnippetSerializer
|
|
|
|
|
|
class SnippetDetail(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = Snippet.objects.all()
|
|
serializer_class = SnippetSerializer |