Skip to content

Commit 9a03129

Browse files
committed
review comments from PR #41
1 parent 6b69297 commit 9a03129

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rest_framework_datatables/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def filter_queryset(self, request, queryset, view):
7474

7575
# order queryset
7676
if len(ordering):
77-
if hasattr(view, '_datatables_additional_order_by'):
78-
additional = view._datatables_additional_order_by
77+
if hasattr(view, 'datatables_additional_order_by'):
78+
additional = view.datatables_additional_order_by
7979
# Django will actually only take the first occurrence if the
8080
# same column is added multiple times in an order_by, but it
8181
# feels cleaner to double check for duplicate anyway.

tests/test_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestFilterTestCase(TestCase):
1717
class TestAPIView(ListAPIView):
1818
serializer_class = AlbumSerializer
1919
pagination_class = DatatablesLimitOffsetPagination
20-
_datatables_additional_order_by = 'year'
20+
datatables_additional_order_by = 'year'
2121

2222
def get_queryset(self):
2323
return Album.objects.all()

0 commit comments

Comments
 (0)