mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-09-16 17:22:32 +03:00
Add query parameter filtering to list method
This commit is contained in:
parent
5ef18af3b1
commit
e5e2cbad9a
|
@ -38,6 +38,7 @@ class ListModelMixin:
|
|||
"""
|
||||
def list(self, request, *args, **kwargs):
|
||||
queryset = self.filter_queryset(self.get_queryset())
|
||||
|
||||
try:
|
||||
params = {key: value for key, value in request.query_params.items() if key in self.model._meta.get_fields()}
|
||||
if params is not None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user