Skip to content

Commit 5eb296c

Browse files
auvipysliverc
authored andcommitted
try using python dict instead of ordered dict in pagination field
1 parent a1e2b11 commit 5eb296c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

rest_framework_json_api/pagination.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Pagination fields
33
"""
4-
from collections import OrderedDict
54

65
from rest_framework.pagination import LimitOffsetPagination, PageNumberPagination
76
from rest_framework.utils.urls import remove_query_param, replace_query_param
@@ -36,22 +35,22 @@ def get_paginated_response(self, data):
3635
{
3736
"results": data,
3837
"meta": {
39-
"pagination": OrderedDict(
38+
"pagination": {
4039
[
4140
("page", self.page.number),
4241
("pages", self.page.paginator.num_pages),
4342
("count", self.page.paginator.count),
4443
]
45-
)
44+
}
4645
},
47-
"links": OrderedDict(
46+
"links": {
4847
[
4948
("first", self.build_link(1)),
5049
("last", self.build_link(self.page.paginator.num_pages)),
5150
("next", self.build_link(next)),
5251
("prev", self.build_link(previous)),
5352
]
54-
),
53+
},
5554
}
5655
)
5756

@@ -97,21 +96,21 @@ def get_paginated_response(self, data):
9796
{
9897
"results": data,
9998
"meta": {
100-
"pagination": OrderedDict(
99+
"pagination": {
101100
[
102101
("count", self.count),
103102
("limit", self.limit),
104103
("offset", self.offset),
105104
]
106-
)
105+
}
107106
},
108-
"links": OrderedDict(
107+
"links": {
109108
[
110109
("first", self.get_first_link()),
111110
("last", self.get_last_link()),
112111
("next", self.get_next_link()),
113112
("prev", self.get_previous_link()),
114113
]
115-
),
114+
},
116115
}
117116
)

0 commit comments

Comments
 (0)