You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
412 B
16 lines
412 B
from rest_framework import viewsets
|
|
|
|
from .serializers import CourseSerializer
|
|
from . import ExtendedModelViewSet
|
|
|
|
from apps.course.models import Course
|
|
|
|
|
|
class CourseViewSet(ExtendedModelViewSet):
|
|
queryset = Course.objects.select_related(
|
|
'author', 'category'
|
|
).prefetch_related(
|
|
'likes', 'materials'
|
|
).all()
|
|
serializer_class = CourseSerializer
|
|
filter_fields = ('category',)
|
|
|