mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-28 16:25:44 +08:00
Fixed subject serializer and added drf-yasg for better endpoint documentation
This commit is contained in:
parent
a33b32436d
commit
c955cadc18
6 changed files with 117 additions and 14 deletions
|
@ -1,8 +1,8 @@
|
|||
from django.urls import include, path
|
||||
from .views import SubjectByYearSemesterView, SubjectListView
|
||||
from .views import SubjectByCourseYearSemesterView, SubjectListView
|
||||
from rest_framework import routers
|
||||
urlpatterns = [
|
||||
path('', SubjectListView.as_view()),
|
||||
path('<slug:course_slug>/<slug:year_slug>/<slug:semester_slug>',
|
||||
SubjectByYearSemesterView.as_view()),
|
||||
SubjectByCourseYearSemesterView.as_view()),
|
||||
]
|
||||
|
|
|
@ -10,8 +10,9 @@ class SubjectListView(generics.ListAPIView):
|
|||
queryset = Subject.objects.all()
|
||||
|
||||
|
||||
class SubjectByYearSemesterView(generics.ListAPIView):
|
||||
class SubjectByCourseYearSemesterView(generics.ListAPIView):
|
||||
queryset = Subject.objects.all()
|
||||
serializer_class = SubjectSerializer
|
||||
|
||||
def get(self, request, course_slug, year_slug, semester_slug):
|
||||
# Retrieve the subjects based on year level and semester slugs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue