Created
September 29, 2020 23:11
-
-
Save codetombomb/fe0fa32f36e788de033a1485c148e06c to your computer and use it in GitHub Desktop.
Editing the app views to format JSON output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import viewsets | |
from .serializers import ProjectsSerializer | |
from .models import Projects | |
class ProjectsViewSet(viewsets.ModelViewSet): | |
queryset = Projects.objects.all() | |
serializer_class = ProjectsSerializer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment