Skip to content

Commit 5220b68

Browse files
authored
Merge pull request #97 from stefanofusai/95-fix-django-truncating-values-results
2 parents 65ff0b1 + 24561d3 commit 5220b68

File tree

3 files changed

+63
-107
lines changed

3 files changed

+63
-107
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "drf-caching"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
description = "Handle views caching in Django Rest Framework."
55
readme = "README.md"
66
authors = [

src/drf_caching/keys.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _get_data(
129129
for field in obj._meta.get_fields(): # noqa: SLF001
130130
_attr = getattr(obj, field.name)
131131
data[field.name] = (
132-
_attr.all().values_list() if isinstance(_attr, Manager) else _attr
132+
list(_attr.all().values_list()) if isinstance(_attr, Manager) else _attr
133133
)
134134

135135
return data
@@ -148,7 +148,7 @@ def _get_data(
148148
) -> dict[str, Any]:
149149
return {
150150
"querylist": [
151-
querylist["queryset"].values_list()
151+
list(querylist["queryset"].values_list())
152152
for querylist in view_instance.filter_queryset(
153153
view_instance.get_querylist()
154154
)
@@ -168,9 +168,11 @@ def _get_data(
168168
**kwargs: Any,
169169
) -> dict[str, Any]:
170170
return {
171-
"queryset": view_instance.filter_queryset(
172-
view_instance.get_queryset()
173-
).values_list()
171+
"queryset": list(
172+
view_instance.filter_queryset(
173+
view_instance.get_queryset()
174+
).values_list()
175+
)
174176
}
175177

176178

0 commit comments

Comments
 (0)