From 00da2414827987e9934ebe7bf2f9a3afea1cdb13 Mon Sep 17 00:00:00 2001 From: Jeff Fein-Worton Date: Fri, 12 Dec 2014 22:14:22 -0800 Subject: documentation typo base-name -> base_name--- docs/api-guide/routers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/api-guide/routers.md b/docs/api-guide/routers.md index 080230fa..929a1710 100644 --- a/docs/api-guide/routers.md +++ b/docs/api-guide/routers.md @@ -41,7 +41,7 @@ The example above would generate the following URL patterns: **Note**: The `base_name` argument is used to specify the initial part of the view name pattern. In the example above, that's the `user` or `account` part. -Typically you won't *need* to specify the `base-name` argument, but if you have a viewset where you've defined a custom `get_queryset` method, then the viewset may not have a `.queryset` attribute set. If you try to register that viewset you'll see an error like this: +Typically you won't *need* to specify the `base_name` argument, but if you have a viewset where you've defined a custom `get_queryset` method, then the viewset may not have a `.queryset` attribute set. If you try to register that viewset you'll see an error like this: 'base_name' argument not specified, and could not automatically determine the name from the viewset, as it does not have a '.queryset' attribute. -- cgit v1.2.3 From 2d470eef809b119c8c72009c81d652ddbf895e0b Mon Sep 17 00:00:00 2001 From: Brian Jacobel Date: Sat, 13 Dec 2014 14:47:11 -0500 Subject: Change serializers.Field to serializers.ReadOnlyField for 3.x compatibility Using this code snippet as-is on DRF 3.0.1 results in a NotImplementedError being raised for to_representation due to 3.0's changed behavior with serializers.Field. The code snippet should be updated to use serializers.ReadOnlyField instead. Further discussion here: https://groups.google.com/forum/?fromgroups=#!topic/django-rest-framework/aX8mLT_v3yc --- docs/api-guide/pagination.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/api-guide/pagination.md b/docs/api-guide/pagination.md index 9b7086c5..83429292 100644 --- a/docs/api-guide/pagination.md +++ b/docs/api-guide/pagination.md @@ -128,7 +128,7 @@ For example, to nest a pair of links labelled 'prev' and 'next', and set the nam class CustomPaginationSerializer(pagination.BasePaginationSerializer): links = LinksSerializer(source='*') # Takes the page object as the source - total_results = serializers.Field(source='paginator.count') + total_results = serializers.ReadOnlyField(source='paginator.count') results_field = 'objects' -- cgit v1.2.3