djresttoolkit 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- djresttoolkit/pagination/_paginated_data_builder.py +4 -0
- {djresttoolkit-1.2.0.dist-info → djresttoolkit-1.2.1.dist-info}/METADATA +9 -5
- {djresttoolkit-1.2.0.dist-info → djresttoolkit-1.2.1.dist-info}/RECORD +6 -6
- {djresttoolkit-1.2.0.dist-info → djresttoolkit-1.2.1.dist-info}/WHEEL +0 -0
- {djresttoolkit-1.2.0.dist-info → djresttoolkit-1.2.1.dist-info}/entry_points.txt +0 -0
- {djresttoolkit-1.2.0.dist-info → djresttoolkit-1.2.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: djresttoolkit
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.1
|
4
4
|
Summary: A collection of Django and DRF utilities to simplify API development.
|
5
5
|
Project-URL: Homepage, https://github.com/shaileshpandit141/djresttoolkit
|
6
6
|
Project-URL: Documentation, https://shaileshpandit141.github.io/djresttoolkit
|
@@ -970,7 +970,7 @@ from djresttoolkit.pagination import PaginatedDataBuilder
|
|
970
970
|
```python
|
971
971
|
builder = PaginatedDataBuilder(
|
972
972
|
request=request,
|
973
|
-
serializer_class=
|
973
|
+
serializer_class=BookSerializer,
|
974
974
|
queryset=MyModel.objects.all()
|
975
975
|
)
|
976
976
|
```
|
@@ -979,7 +979,7 @@ builder = PaginatedDataBuilder(
|
|
979
979
|
- `serializer_class: type[BaseSerializer]`:- DRF serializer class for the model.
|
980
980
|
- `queryset: QuerySet`:- Django queryset to paginate.
|
981
981
|
|
982
|
-
### Paginated Data Builder Methods
|
982
|
+
### Paginated Data Builder Methods and Property
|
983
983
|
|
984
984
|
- `get_paginated_data() -> dict[str, Any]`
|
985
985
|
|
@@ -987,6 +987,10 @@ builder = PaginatedDataBuilder(
|
|
987
987
|
- Serializes the paginated results.
|
988
988
|
- Returns a dictionary with `"page"` and `"results"`.
|
989
989
|
- Raises `NotFound` if no page data is found.
|
990
|
+
|
991
|
+
- `paginated_data -> dict[str, Any]`
|
992
|
+
|
993
|
+
- Call `paginated_data` property that internaly call `get_paginated_data()` method
|
990
994
|
|
991
995
|
### Example Response of Paginated Data Builder
|
992
996
|
|
@@ -1001,8 +1005,8 @@ builder = PaginatedDataBuilder(
|
|
1001
1005
|
"previous": "http://api.example.com/items/?page=1&page-size=20"
|
1002
1006
|
},
|
1003
1007
|
"results": [
|
1004
|
-
{ "id": 21, "
|
1005
|
-
{ "id": 22, "
|
1008
|
+
{ "id": 21, "title": "Title 21" },
|
1009
|
+
{ "id": 22, "title": "Title 22" }
|
1006
1010
|
]
|
1007
1011
|
}
|
1008
1012
|
```
|
@@ -32,7 +32,7 @@ djresttoolkit/models/mixins/__init__.py,sha256=MHwv36f3nHwI0bXeejuO7MTYuV93ln2tS
|
|
32
32
|
djresttoolkit/models/mixins/_model_choice_fields_mixin.py,sha256=9FZbe3PwrtIUZYGQh1gcOix5bfeyvKEOaNmkemvZX8E,2843
|
33
33
|
djresttoolkit/pagination/__init__.py,sha256=lQhyyX381RbWBsYV9Os3OQIbY7Z6aouL0QE5kI_u5SU,176
|
34
34
|
djresttoolkit/pagination/_page_number_pagination.py,sha256=NHPdMZfmTurKLdgpMBT2usTiGAoZMyA3dYXq_n11y34,2358
|
35
|
-
djresttoolkit/pagination/_paginated_data_builder.py,sha256=
|
35
|
+
djresttoolkit/pagination/_paginated_data_builder.py,sha256=oASu4wA8hN8vaPlh4rx0HM600CUVO179M25JEr9pRx4,2424
|
36
36
|
djresttoolkit/renderers/__init__.py,sha256=kmFMPRiMfD8CuJTN1_-6Z_Hqil3x8GBM0IN1roZESm0,107
|
37
37
|
djresttoolkit/renderers/_throttle_info_json_renderer.py,sha256=aP2cN4cB_Imcpy732zsPBQrMQqcKEs5R3dld5Y_4AMU,1089
|
38
38
|
djresttoolkit/serializers/__init__.py,sha256=367CLluj8C15Zpr7BD-euP4DxKbwepm58gnGGcuYOJU,103
|
@@ -51,8 +51,8 @@ djresttoolkit/views/_exceptions/__init__.py,sha256=DrCUxuPNyBR4WhzNutn5HDxLa--q5
|
|
51
51
|
djresttoolkit/views/_exceptions/_exception_handler.py,sha256=_o7If47bzWLl57LeSXSWsIDsJGo2RIpwYAwNQ-hsHVY,2839
|
52
52
|
djresttoolkit/views/mixins/__init__.py,sha256=mHD49OUxuJ9v81tGfM0hLnUJuJlYi7E-5cTVdplh-vs,91
|
53
53
|
djresttoolkit/views/mixins/_retrieve_object_mixin.py,sha256=v7CQDUkRWjtevFZnAYRBdDl7wcfYWF3evWoKWHAcckA,1749
|
54
|
-
djresttoolkit-1.2.
|
55
|
-
djresttoolkit-1.2.
|
56
|
-
djresttoolkit-1.2.
|
57
|
-
djresttoolkit-1.2.
|
58
|
-
djresttoolkit-1.2.
|
54
|
+
djresttoolkit-1.2.1.dist-info/METADATA,sha256=tfUlUP1aTjciJVuxWBmGMr_pJngjAOKwihneOuThlUI,32697
|
55
|
+
djresttoolkit-1.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
56
|
+
djresttoolkit-1.2.1.dist-info/entry_points.txt,sha256=YMhfTF-7mYppO8QqqWnvR_hyMWvoYxD6XI94_ViFu3k,60
|
57
|
+
djresttoolkit-1.2.1.dist-info/licenses/LICENSE,sha256=8-oZM3yuuTRjySMbVKX9YXYA7Y4M_KhQNBYXPFjeWUo,1074
|
58
|
+
djresttoolkit-1.2.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|