Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 157d878

Browse files
Merge branch 'master' into links-mixin
2 parents 410fa87 + e33df0a commit 157d878

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

‎CHANGELOG.md‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
v2.5.0 - [unreleased]
1+
[unreleased]
2+
3+
* Add testing configuration to `REST_FRAMEWORK` configuration as described in [DRF](http://www.django-rest-framework.org/api-guide/testing/#configuration)
4+
* Add sorting configuration to `REST_FRAMEWORK` as defined in [json api spec](http://jsonapi.org/format/#fetching-sorting)
5+
* Added `HyperlinkedRelatedField` and `SerializerMethodHyperlinkedRelatedField`. See [usage docs](docs/usage.md#related-fields).
6+
7+
8+
v2.5.0 - Released July 11, 2018
9+
210
* Add new pagination classes based on JSON:API query parameter *recommendations*:
311
* `JsonApiPageNumberPagination` and `JsonApiLimitOffsetPagination`. See [usage docs](docs/usage.md#pagination).
4-
* Deprecates `PageNumberPagination` and `LimitOffsetPagination`.
5-
* Add `ReadOnlyModelViewSet` extension with prefetch mixins.
12+
* Deprecates `PageNumberPagination` and `LimitOffsetPagination`
13+
* Add `ReadOnlyModelViewSet` extension with prefetch mixins
614
* Add support for Django REST Framework 3.8.x
7-
* Introduce `JSON_API_FORMAT_FIELD_NAMES` option replacing `JSON_API_FORMAT_KEYS` but in comparision preserving
15+
* Introduce `JSON_API_FORMAT_FIELD_NAMES` option replacing `JSON_API_FORMAT_KEYS` but in comparison preserving
816
values from being formatted as attributes can contain any [json value](http://jsonapi.org/format/#document-resource-object-attributes).
9-
* `JSON_API_FORMAT_KEYS` still works as before (formating all json value keys also nested) but is marked as deprecated.
10-
* Added `HyperlinkedRelatedField` and `SerializerMethodHyperlinkedRelatedField`. See [usage docs](docs/usage.md#related-fields).
17+
* `JSON_API_FORMAT_KEYS` still works as before (formatting all json value keys also nested) but is marked as deprecated
18+
* Performance improvement when rendering included data
19+
* Allow overwriting of `get_queryset()` in custom `ResourceRelatedField`
1120

1221
v2.4.0 - Released January 25, 2018
1322

‎README.rst‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ override ``settings.REST_FRAMEWORK``
140140
'PAGE_SIZE': 10,
141141
'EXCEPTION_HANDLER': 'rest_framework_json_api.exceptions.exception_handler',
142142
'DEFAULT_PAGINATION_CLASS':
143-
'rest_framework_json_api.pagination.PageNumberPagination',
143+
'rest_framework_json_api.pagination.JsonApiPageNumberPagination',
144144
'DEFAULT_PARSER_CLASSES': (
145145
'rest_framework_json_api.parsers.JSONParser',
146146
'rest_framework.parsers.FormParser',
@@ -151,10 +151,14 @@ override ``settings.REST_FRAMEWORK``
151151
'rest_framework.renderers.BrowsableAPIRenderer',
152152
),
153153
'DEFAULT_METADATA_CLASS': 'rest_framework_json_api.metadata.JSONAPIMetadata',
154+
'DEFAULT_FILTER_BACKENDS': (
155+
'rest_framework.filters.OrderingFilter',
156+
),
157+
'ORDERING_PARAM': 'sort',
158+
'TEST_REQUEST_RENDERER_CLASSES': (
159+
'rest_framework_json_api.renderers.JSONRenderer',
160+
),
161+
'TEST_REQUEST_DEFAULT_FORMAT': 'vnd.api+json'
154162
}
155163

156-
If ``PAGINATE_BY`` is set the renderer will return a ``meta`` object with
157-
record count and a ``links`` object with the next and previous links. Pages
158-
can be specified with the ``page`` GET parameter.
159-
160164
This package provides much more including automatic inflection of JSON keys, extra top level data (using nested serializers), relationships, links, and handy shortcuts like MultipleIDMixin. Read more at http://django-rest-framework-json-api.readthedocs.org/

‎docs/usage.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ REST_FRAMEWORK = {
3131
'rest_framework.renderers.BrowsableAPIRenderer'
3232
),
3333
'DEFAULT_METADATA_CLASS': 'rest_framework_json_api.metadata.JSONAPIMetadata',
34+
'DEFAULT_FILTER_BACKENDS': (
35+
'rest_framework.filters.OrderingFilter',
36+
),
37+
'ORDERING_PARAM': 'sort',
38+
'TEST_REQUEST_RENDERER_CLASSES': (
39+
'rest_framework_json_api.renderers.JSONRenderer',
40+
),
41+
'TEST_REQUEST_DEFAULT_FORMAT': 'vnd.api+json'
3442
}
3543
```
3644

‎example/settings/dev.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
'rest_framework.renderers.BrowsableAPIRenderer',
8989
),
9090
'DEFAULT_METADATA_CLASS': 'rest_framework_json_api.metadata.JSONAPIMetadata',
91+
'DEFAULT_FILTER_BACKENDS': (
92+
'rest_framework.filters.OrderingFilter',
93+
),
94+
'ORDERING_PARAM': 'sort',
9195
'TEST_REQUEST_RENDERER_CLASSES': (
9296
'rest_framework_json_api.renderers.JSONRenderer',
9397
),

‎rest_framework_json_api/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
__title__ = 'djangorestframework-jsonapi'
4-
__version__ = '2.4.0'
4+
__version__ = '2.5.0'
55
__author__ = ''
66
__license__ = 'MIT'
77
__copyright__ = ''

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /