-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure quibs api viewset and endpoints
- Loading branch information
1 parent
11997c4
commit 06a7045
Showing
6 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from rest_framework import serializers | ||
|
||
from apps.quib.models import Quib | ||
|
||
|
||
class QuibSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Quib | ||
fields = '__all__' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from rest_framework import routers | ||
|
||
from .viewsets import QuibViewSet | ||
|
||
router = routers.DefaultRouter() | ||
router.register(r'', QuibViewSet) | ||
|
||
urlpatterns = router.urls |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from rest_framework import viewsets | ||
|
||
from apps.quib.models import Quib | ||
|
||
from .serializers import QuibSerializer | ||
|
||
|
||
class QuibViewSet(viewsets.ModelViewSet): | ||
queryset = Quib.objects.all() | ||
serializer_class = QuibSerializer |
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