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.
22 lines
601 B
22 lines
601 B
from rest_framework.permissions import IsAuthenticated
|
|
from rest_framework.response import Response
|
|
from rest_framework.generics import ListAPIView
|
|
|
|
from apps.library.models import *
|
|
from apps.library.serializers import *
|
|
|
|
|
|
|
|
class BannerListView(ListAPIView):
|
|
serializer_class = BannerListSerializer
|
|
permission_classes = (IsAuthenticated,)
|
|
pagination_class = None
|
|
|
|
def get_queryset(self):
|
|
_query = Q(status=True, display_position=BookCollection.DisplayPosition.TOP)
|
|
|
|
return Collection.objects.filter(
|
|
_query,
|
|
).order_by('-order', '-id', )
|
|
|
|
|