Skip to content

Commit a662a2a

Browse files
committed
Sideloading resource documentation
1 parent 645f3aa commit a662a2a

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

README.rst

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ override ``settings.REST_FRAMEWORK``::
117117
}
118118

119119

120+
120121
If ``PAGINATE_BY`` is set the renderer will return a ``meta`` object with
121122
record count and the next and previous links. Django Rest Framework looks
122123
for the ``page`` GET parameter by default allowing you to make requests for
123124
subsets of the data with ``this.store.find('identity', {page: 2});``.
124125

125-
126126
resource_name property
127127
^^^^^^^^^^^^^^^^^^^^^^
128128

@@ -216,16 +216,35 @@ To display a specific error inline use the following::
216216
{{/each}}
217217
{{input name="title" value=title}}
218218

219-
======
219+
220+
---------------------
221+
Sideloading Resources
222+
---------------------
223+
224+
If you are using the JSON Renderer globally, this can lead to issues
225+
when hitting endpoints that are intended to sideload other objects.
226+
227+
For example::
228+
229+
{
230+
"users": [],
231+
"cars": []
232+
}
233+
234+
235+
Set the ``resource_name`` property on the object to ``False``, and the data
236+
will be returned as it is above.
237+
238+
239+
------
220240
Mixins
221-
======
241+
------
222242

223243
The following mixin classes are available to use with Rest Framework
224244
resources.
225245

226-
-------------------------------------------
227246
rest_framework_ember.mixins.MultipleIDMixin
228-
-------------------------------------------
247+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229248

230249
Overrides ``get_queryset`` to filter by ``ids[]`` in URL query params.
231250

0 commit comments

Comments
 (0)