|
|
@ -32,11 +32,16 @@ class CourseListAPIView(ListAPIView): |
|
|
queryset = Course.objects.all().exclude(status=Course.StatusChoices.INACTIVE) |
|
|
queryset = Course.objects.all().exclude(status=Course.StatusChoices.INACTIVE) |
|
|
serializer_class = CourseListSerializer |
|
|
serializer_class = CourseListSerializer |
|
|
filter_backends = [SearchFilter] |
|
|
filter_backends = [SearchFilter] |
|
|
search_fields = ['title'] |
|
|
|
|
|
|
|
|
search_fields = ['title', 'category__name', 'professor__fullname'] |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description=doc_course_list(), |
|
|
operation_description=doc_course_list(), |
|
|
manual_parameters=[ |
|
|
manual_parameters=[ |
|
|
|
|
|
openapi.Parameter( |
|
|
|
|
|
'search', openapi.IN_QUERY, |
|
|
|
|
|
description="Search by course title, category name, or professor's full name", |
|
|
|
|
|
type=openapi.TYPE_STRING, |
|
|
|
|
|
), |
|
|
openapi.Parameter( |
|
|
openapi.Parameter( |
|
|
'category_slug', openapi.IN_QUERY, |
|
|
'category_slug', openapi.IN_QUERY, |
|
|
description="Category of the Course", |
|
|
description="Category of the Course", |
|
|
|