Please enable JavaScript.
Coggle requires JavaScript to display documents.
ADVANCED_API_2 - Coggle Diagram
ADVANCED_API_2
PAGINATE
Import
Pagination
PageNumberPagination
LimitOffsetPagination
Way1
PaginationClass
PageNumberPagination
Settings
PageSize
10
Way2
Settings
DefaultPaginationClass
PageSize
Way3
Pagination.py
DefaultPagination
Create
Extends
PageNumberPagination
PageSize
Attribute
10
Use
Viewset
In
FILTER
QueryParams
Override
GetQueryset
Queryset
Model.objects.all()
QueryKey
Self.Request
QueryParams
Get
Key
Exist
Filter
Query_key
Return
None
Return
Queryset
SEARCH
Import
Rest_Framework
Filters
SearchFilter
FilterBackends
Add
SearchFilter
SearchFields
List
Fields
Relation__field
SORT
Import
Rest_framework
Filters
OrderingFilter
FilterBackends
Add
OrderingFilter
OrderingFields
List
Fields
GENERIC_FILTER
Install
DjangoFilter
INSTALLED_APPS
Django_filter
Views
Import
Django_filter
Rest_framework
DjangoFilterBackend
ModelNameViewSet
FilterBackends
[DjangoFilterBackend]
FiltersetFields
List
Fields
Custom
Filters.py
Import
Django_filter
Rest_framework
FilterSet
ModelNameFilter
Extends
FilterSet
Meta
model
Fields
Dict
Key
FieldName
Value
[FilterType]
Exact/lt/gt
Use
FiltersetClass
ModelNameFilter
FilterBackends
[DjangoFilterBackend]