mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Add REST API pagination and mke REST API optional (#43)
* Implement Rest API pagination * REST API must be enabled in settings * Report REST API status in the admin site settings page
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
||||
|
||||
from ram.views import CustomLimitOffsetPagination
|
||||
from consist.models import Consist
|
||||
from consist.serializers import ConsistSerializer
|
||||
|
||||
|
||||
class ConsistList(ListAPIView):
|
||||
serializer_class = ConsistSerializer
|
||||
pagination_class = CustomLimitOffsetPagination
|
||||
|
||||
def get_queryset(self):
|
||||
return Consist.objects.get_published(self.request.user)
|
||||
|
Reference in New Issue
Block a user