Filtering
Default Filtering
GenericAPIView + .get_queryset()
조합
get_queryset() -> Overiding
- current user
- URL
- query parameters
Generic Filtering
GenericAPIView + filter_backends 조합
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend']
}
- filter_backends =[django_filters.rest_framework.DjangoFilterBackend]
Custom generic filtering
BaseFilterBackend + .filter_queryset(self, request, quertset, view) 조합
참고자료
공식문서