Skip to content

Instantly share code, notes, and snippets.

@Kristian-Roopnarine
Created February 10, 2020 20:59
Show Gist options
  • Save Kristian-Roopnarine/b35e73508b511ba386f9263d30a585e6 to your computer and use it in GitHub Desktop.
Save Kristian-Roopnarine/b35e73508b511ba386f9263d30a585e6 to your computer and use it in GitHub Desktop.
from backend.models import ProjectInfo
from rest_framework import viewsets
from .serializers import ProjectInfoSerializer
# Project Info viewset
# allows us to create a CRUD api without specifying methods for functionality
class ProjectInfoViewSet(viewsets.ModelViewSet):
queryset = ProjectInfo.objects.filter(show=True)
serializer_class = ProjectInfoSerializer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment