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
128128^^^^^^^^^^^^^^^^^^^^^^
129129
130130On 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::
132132
133133 class Me(generics.GenericAPIView):
134134 """
@@ -147,7 +147,7 @@ Managing the trailing slash
147147
148148By default Django expects a trailing slash on urls and will 301 redirect any
149149requests 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::
151151
152152 router = routers.SimpleRouter(trailing_slash=False)
153153
@@ -156,7 +156,7 @@ in Django's settings.py file and modify url pattern regex to match routes
156156without a trailing slash.
157157
158158If 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::
160160
161161 App.ApplicationAdapter = DS.RESTAdapter.extend({
162162 buildURL: function() {
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ def test_key_in_list_result(self):
4141 self .assertEquals (meta .get ('count' , 0 ),
4242 get_user_model ().objects .count ())
4343 self .assertEquals (meta .get ("next" ), 2 )
44+ self .assertEqual ('http://testserver/user-viewset/?page=2' ,
45+ meta .get ("next_link" ))
4446 self .assertEqual (meta .get ("page" ), 1 )
4547
4648 def test_page_two_in_list_result (self ):
@@ -65,7 +67,10 @@ def test_page_two_in_list_result(self):
6567 self .assertEquals (meta .get ('count' , 0 ),
6668 get_user_model ().objects .count ())
6769 self .assertIsNone (meta .get ("next" ))
70+ self .assertIsNone (meta .get ("next_link" ))
6871 self .assertEqual (meta .get ("previous" ), 1 )
72+ self .assertEqual ('http://testserver/user-viewset/?page=1' ,
73+ meta .get ("previous_link" ))
6974 self .assertEqual (meta .get ("page" ), 2 )
7075
7176 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):
7575 next_link = NextPageLinkField (source = '*' )
7676 page = PageField (source = '*' )
7777 previous = PreviousPageField (source = '*' )
78- previous_link = PreviousPageField (source = '*' )
78+ previous_link = PreviousPageLinkField (source = '*' )
7979 count = serializers .Field (source = 'paginator.count' )
8080
You can’t perform that action at this time.
0 commit comments