File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ resource_name property
128
128
^^^^^^^^^^^^^^^^^^^^^^
129
129
130
130
On resources that do not subclass ``rest_framework.viewsets.ModelViewSet ``,
131
- the ``resource_name `` property is required on the class. ::
131
+ the ``resource_name `` property is required on the class::
132
132
133
133
class Me(generics.GenericAPIView):
134
134
"""
@@ -147,7 +147,7 @@ Managing the trailing slash
147
147
148
148
By default Django expects a trailing slash on urls and will 301 redirect any
149
149
requests lacking a trailing slash. You can change the server side by
150
- instantiating the Django REST Framework's router like so:::
150
+ instantiating the Django REST Framework's router like so::
151
151
152
152
router = routers.SimpleRouter(trailing_slash=False)
153
153
@@ -156,7 +156,7 @@ in Django's settings.py file and modify url pattern regex to match routes
156
156
without a trailing slash.
157
157
158
158
If you prefer to make the change on the client side then add an
159
- application adapter to your Ember app and override the buildURL method:::
159
+ application adapter to your Ember app and override the buildURL method::
160
160
161
161
App.ApplicationAdapter = DS.RESTAdapter.extend({
162
162
buildURL: function() {
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ def test_key_in_list_result(self):
41
41
self .assertEquals (meta .get ('count' , 0 ),
42
42
get_user_model ().objects .count ())
43
43
self .assertEquals (meta .get ("next" ), 2 )
44
+ self .assertEqual ('http://testserver/user-viewset/?page=2' ,
45
+ meta .get ("next_link" ))
44
46
self .assertEqual (meta .get ("page" ), 1 )
45
47
46
48
def test_page_two_in_list_result (self ):
@@ -65,7 +67,10 @@ def test_page_two_in_list_result(self):
65
67
self .assertEquals (meta .get ('count' , 0 ),
66
68
get_user_model ().objects .count ())
67
69
self .assertIsNone (meta .get ("next" ))
70
+ self .assertIsNone (meta .get ("next_link" ))
68
71
self .assertEqual (meta .get ("previous" ), 1 )
72
+ self .assertEqual ('http://testserver/user-viewset/?page=1' ,
73
+ meta .get ("previous_link" ))
69
74
self .assertEqual (meta .get ("page" ), 2 )
70
75
71
76
def test_page_range_in_list_result (self ):
Original file line number Diff line number Diff line change @@ -75,6 +75,6 @@ class EmberPaginationSerializer(pagination.BasePaginationSerializer):
75
75
next_link = NextPageLinkField (source = '*' )
76
76
page = PageField (source = '*' )
77
77
previous = PreviousPageField (source = '*' )
78
- previous_link = PreviousPageField (source = '*' )
78
+ previous_link = PreviousPageLinkField (source = '*' )
79
79
count = serializers .Field (source = 'paginator.count' )
80
80
You can’t perform that action at this time.
0 commit comments