Skip to content

Commit

Permalink
Merge pull request #417 from fecgov/feature/989-add-transactions-list…
Browse files Browse the repository at this point in the history
…-table

Feature/989 Add custom pagination to transactions
  • Loading branch information
mjtravers authored May 1, 2023
2 parents c366afc + 5eef453 commit 543a9fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django-backend/fecfiler/transactions/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from rest_framework import filters
from rest_framework import filters, pagination
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import status
Expand All @@ -17,6 +17,11 @@
logger = logging.getLogger(__name__)


class TransactionListPagination(pagination.PageNumberPagination):
page_size = 5
page_size_query_param = "page_size"


class TransactionViewSetBase(CommitteeOwnedViewSet, ReportViewMixin):
""" """

Expand Down Expand Up @@ -45,6 +50,7 @@ class TransactionViewSet(CommitteeOwnedViewSet, ReportViewMixin):
)
)
serializer_class = TransactionSerializerBase
pagination_class = TransactionListPagination
filter_backends = [filters.OrderingFilter]

ordering_fields = [
Expand Down

0 comments on commit 543a9fc

Please sign in to comment.