Skip to content

Commit

Permalink
Clarify docs on controlling compound documents (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
nattyg93 authored and sliverc committed Feb 25, 2019
1 parent 876892f commit 95e7ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Mohammed Ali Zubair <mazg1493@gmail.com>
Jason Housley <housleyjk@gmail.com>
Beni Keller <beni@matraxi.ch>
Stas S. <stas@nerd.ro>
Nathanael Gordon <nathanael.l.gordon@gmail.com>
8 changes: 3 additions & 5 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,9 @@ that are related to the primary resource.

To make a Compound Document,
you need to modify your `ModelSerializer`.
The two required additions are `included_resources`
and `included_serializers`.
`included_serializers` is required to inform DJA of what and how you would like
to include.
`included_resources` tells DJA what you want to include by default.

For example,
suppose you are making an app to go on quests,
Expand Down Expand Up @@ -818,9 +819,6 @@ class QuestSerializer(serializers.ModelSerializer):
included_resources = ['knight']
```

`included_resources` informs DJA of **what** you would like to include.
`included_serializers` tells DJA **how** you want to include it.

#### Performance improvements

Be aware that using included resources without any form of prefetching **WILL HURT PERFORMANCE** as it will introduce m\*(n+1) queries.
Expand Down

0 comments on commit 95e7ed4

Please sign in to comment.