Skip to content

Commit 74c2bed

Browse files
authored
Add a comment explaining why dicts are excluded from filtering (#140)
1 parent fc09da3 commit 74c2bed

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
# [unreleased]
88
- [PR 138](https://github.com/salesforce/django-declarative-apis/pull/138) Docs: Correct imports in code-blocks
99
- [PR 139](https://github.com/salesforce/django-declarative-apis/pull/139) Docs: Correct documentation for default value of `required` on `field`
10+
- [PR 140](https://github.com/salesforce/django-declarative-apis/pull/140) Docs: Add comment explaining why `dict`s don't have filters applied
1011

1112
# [0.31.4] - 2023-10-12
1213
- [PR 137](https://github.com/salesforce/django-declarative-apis/pull/137) Finalize endpoints before dispatching async tasks

django_declarative_apis/machinery/filtering.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def _get_filtered_field_value( # noqa: C901
171171
val = val.all()
172172

173173
# should this value be passed through the filters itself?
174+
# `dict` is intentionally excluded to allow endpoints to return an arbitrary response that bypasses filtering
174175
if val.__class__ in filter_def or isinstance(
175176
val, (list, tuple, models.Model, models.query.QuerySet, pydantic.BaseModel)
176177
):

0 commit comments

Comments
 (0)