Skip to content

Commit 635716a

Browse files
committed
black
Signed-off-by: Drew Shafer <[email protected]>
1 parent b80b4d3 commit 635716a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

django_declarative_apis/machinery/filtering.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ def _apply_filters_to_object(inst, filter_def, expand_children=None, klass=None)
116116
for item in inst
117117
]
118118
elif isinstance(inst, (dict,)):
119-
return {k: _apply_filters_to_object(v, filter_def, expand_children=expand_children, klass=v.__class__) for k, v in inst.items()}
119+
return {
120+
k: _apply_filters_to_object(
121+
v, filter_def, expand_children=expand_children, klass=v.__class__
122+
)
123+
for k, v in inst.items()
124+
}
120125

121126
fields_def = filter_def.get(klass)
122127
if fields_def is None:

tests/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def test_dict_endpoint(self):
4646
"pk": 1,
4747
"int_field": 1,
4848
"__expandable__": ["expandable_dict", "expandable_string"],
49-
},
50-
}
49+
}
50+
},
5151
},
5252
)
5353

tests/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,4 @@ def is_authorized(self):
4343
@endpoint_resource(type=TestModel)
4444
def resource(self):
4545
inst = TestModel.objects.create(int_field=1)
46-
return {"test": inst,
47-
"deep_test": {
48-
"test": inst
49-
}}
46+
return {"test": inst, "deep_test": {"test": inst}}

0 commit comments

Comments
 (0)