Skip to content

Commit ca65729

Browse files
committed
Added docs
1 parent 42a9448 commit ca65729

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ When set to pluralize:
324324

325325
### Related fields
326326

327+
#### ResourceRelatedField
328+
327329
Because of the additional structure needed to represent relationships in JSON
328330
API, this package provides the `ResourceRelatedField` for serializers, which
329331
works similarly to `PrimaryKeyRelatedField`. By default,
@@ -435,6 +437,12 @@ class LineItemViewSet(viewsets.ModelViewSet):
435437
return queryset
436438
```
437439

440+
#### HyperlinkedRelatedField
441+
442+
In order to improve performance by saving some sql queries we can skip `data`
443+
key. Use `HyperlinkedRelatedField`. It works same as `ResourceRelatedField`
444+
but just skips `data` calculating.
445+
438446
### RelationshipView
439447
`rest_framework_json_api.views.RelationshipView` is used to build
440448
relationship views (see the

0 commit comments

Comments
 (0)