You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-76Lines changed: 76 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,100 +14,100 @@ DRF-sideloading is an extension to provide side-loading functionality of related
14
14
15
15
## Quickstart
16
16
17
-
1. Install drf-sideloading:
17
+
1.Install drf-sideloading:
18
18
19
-
```shell
20
-
pip install drf-sideloading
21
-
```
19
+
```shell
20
+
pip install drf-sideloading
21
+
```
22
22
23
23
2. Import `SideloadableRelationsMixin`:
24
24
25
-
```python
26
-
from drf_sideloading.mixins import SideloadableRelationsMixin
27
-
```
25
+
```python
26
+
from drf_sideloading.mixins import SideloadableRelationsMixin
27
+
```
28
28
29
29
3. Write your SideLoadableSerializer
30
30
You need to define the **primary** serializer in the Meta data and can define prefetching rules. Also notice the **many=True** on the sideloadable relationships.
31
31
32
-
```python
33
-
from drf_sideloading.serializers import SideLoadableSerializer
Include **SideloadableRelationsMixin** mixin in ViewSet and define **sideloading_serializer_class** as shown in example below. Evrything else stays just like a regular ViewSet
52
52
53
-
```python
54
-
from drf_sideloading.mixins import SideloadableRelationsMixin
0 commit comments