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 05d8ef4

Browse files
committed
Added a doc note to prefer setting resource_name on serializers or models.
Closes #207
1 parent 11632a5 commit 05d8ef4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎docs/usage.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class Me(models.Model):
8787
If you set the `resource_name` on a combination of model, serializer, or view
8888
in the same hierarchy, the name will be resolved as following: view >
8989
serializer > model. (Ex: A view `resource_name` will always override a
90-
`resource_name` specified on a serializer or model)
90+
`resource_name` specified on a serializer or model). Setting the `resource_name`
91+
on the view should be used sparingly as serializers and models are shared between
92+
multiple endpoints. Setting the `resource_name` on views may result in a different
93+
`type` being set depending on which endpoint the resource is fetched from.
9194

9295

9396
### Inflecting object and relation keys

0 commit comments

Comments
(0)

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