django-ninja-aio-crud 2.10.0__py3-none-any.whl → 2.10.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of django-ninja-aio-crud might be problematic. Click here for more details.
- {django_ninja_aio_crud-2.10.0.dist-info → django_ninja_aio_crud-2.10.1.dist-info}/METADATA +1 -1
- {django_ninja_aio_crud-2.10.0.dist-info → django_ninja_aio_crud-2.10.1.dist-info}/RECORD +7 -7
- ninja_aio/__init__.py +1 -1
- ninja_aio/views/api.py +3 -0
- ninja_aio/views/mixins.py +13 -3
- {django_ninja_aio_crud-2.10.0.dist-info → django_ninja_aio_crud-2.10.1.dist-info}/WHEEL +0 -0
- {django_ninja_aio_crud-2.10.0.dist-info → django_ninja_aio_crud-2.10.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ninja_aio/__init__.py,sha256=
|
|
1
|
+
ninja_aio/__init__.py,sha256=89U1Dj8vplVSbgWDcQsklzcAzW070HQlarC0u9_LOX4,120
|
|
2
2
|
ninja_aio/api.py,sha256=tuC7vdvn7s1GkCnSFy9Kn1zv0glZfYptRQVvo8ZRtGQ,2429
|
|
3
3
|
ninja_aio/auth.py,sha256=4sWdFPjKiQgUL1d_CSGDblVjnY5ptP6LQha6XXdluJA,9157
|
|
4
4
|
ninja_aio/exceptions.py,sha256=_3xFqfFCOfrrMhSA0xbMqgXy8R0UQjhXaExrFvaDAjY,3891
|
|
@@ -21,9 +21,9 @@ ninja_aio/schemas/api.py,sha256=InzZgIFU4Zxkgj9u_zZzAMYs_vdaPD5eu12gG7xAFoQ,1047
|
|
|
21
21
|
ninja_aio/schemas/generics.py,sha256=frjJsKJMAdM_NdNKv-9ddZNGxYy5PNzjIRGtuycgr-w,112
|
|
22
22
|
ninja_aio/schemas/helpers.py,sha256=Vti5BfHWpxaJXj_ixZBJb34VRwhHODrlVjRlIuHh_ug,8428
|
|
23
23
|
ninja_aio/views/__init__.py,sha256=DEzjWA6y3WF0V10nNF8eEurLNEodgxKzyFd09AqVp3s,148
|
|
24
|
-
ninja_aio/views/api.py,sha256=
|
|
25
|
-
ninja_aio/views/mixins.py,sha256=
|
|
26
|
-
django_ninja_aio_crud-2.10.
|
|
27
|
-
django_ninja_aio_crud-2.10.
|
|
28
|
-
django_ninja_aio_crud-2.10.
|
|
29
|
-
django_ninja_aio_crud-2.10.
|
|
24
|
+
ninja_aio/views/api.py,sha256=LUJBvD7oxE3nq6DlMDOHYzNi2KBYQMSbb7SzfZdqcp0,22197
|
|
25
|
+
ninja_aio/views/mixins.py,sha256=YKdJVCjya-VB8bs62DNQZ9Gj3qHpsEJ-2257RbI0K1A,14238
|
|
26
|
+
django_ninja_aio_crud-2.10.1.dist-info/licenses/LICENSE,sha256=yrDAYcm0gRp_Qyzo3GQa4BjYjWRkAhGC8QRva__RYq0,1073
|
|
27
|
+
django_ninja_aio_crud-2.10.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
28
|
+
django_ninja_aio_crud-2.10.1.dist-info/METADATA,sha256=G-t2gFVZicsgYER6sY8HKnSwcNUfBwgClgRqkMRVCUE,9964
|
|
29
|
+
django_ninja_aio_crud-2.10.1.dist-info/RECORD,,
|
ninja_aio/__init__.py
CHANGED
ninja_aio/views/api.py
CHANGED
|
@@ -311,6 +311,9 @@ class APIViewSet(API):
|
|
|
311
311
|
"delete": (None, self.delete_view),
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
def _check_relations_filters(self, filter: str):
|
|
315
|
+
return filter in getattr(self, "relations_filters_fields", [])
|
|
316
|
+
|
|
314
317
|
def _auth_view(self, view_type: str):
|
|
315
318
|
"""
|
|
316
319
|
Resolve auth for a specific HTTP verb; falls back to self.auth if NOT_SET.
|
ninja_aio/views/mixins.py
CHANGED
|
@@ -56,7 +56,7 @@ class IcontainsFilterViewSetMixin(APIViewSet):
|
|
|
56
56
|
**{
|
|
57
57
|
f"{key}__icontains": value
|
|
58
58
|
for key, value in filters.items()
|
|
59
|
-
if isinstance(value, str)
|
|
59
|
+
if isinstance(value, str) and not self._check_relations_filters(key)
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
|
|
@@ -95,7 +95,11 @@ class BooleanFilterViewSetMixin(APIViewSet):
|
|
|
95
95
|
"""
|
|
96
96
|
base_qs = await super().query_params_handler(queryset, filters)
|
|
97
97
|
return base_qs.filter(
|
|
98
|
-
**{
|
|
98
|
+
**{
|
|
99
|
+
key: value
|
|
100
|
+
for key, value in filters.items()
|
|
101
|
+
if isinstance(value, bool) and not self._check_relations_filters(key)
|
|
102
|
+
}
|
|
99
103
|
)
|
|
100
104
|
|
|
101
105
|
|
|
@@ -137,6 +141,7 @@ class NumericFilterViewSetMixin(APIViewSet):
|
|
|
137
141
|
key: value
|
|
138
142
|
for key, value in filters.items()
|
|
139
143
|
if isinstance(value, (int, float))
|
|
144
|
+
and not self._check_relations_filters(key)
|
|
140
145
|
}
|
|
141
146
|
)
|
|
142
147
|
|
|
@@ -179,6 +184,7 @@ class DateFilterViewSetMixin(APIViewSet):
|
|
|
179
184
|
f"{key}{self._compare_attr}": value
|
|
180
185
|
for key, value in filters.items()
|
|
181
186
|
if hasattr(value, "isoformat")
|
|
187
|
+
and not self._check_relations_filters(key)
|
|
182
188
|
}
|
|
183
189
|
)
|
|
184
190
|
|
|
@@ -325,6 +331,10 @@ class RelationFilterViewSetMixin(APIViewSet):
|
|
|
325
331
|
},
|
|
326
332
|
}
|
|
327
333
|
|
|
334
|
+
@property
|
|
335
|
+
def relations_filters_fields(self):
|
|
336
|
+
return [rel_filter.query_param for rel_filter in self.relations_filters]
|
|
337
|
+
|
|
328
338
|
async def query_params_handler(self, queryset, filters):
|
|
329
339
|
"""
|
|
330
340
|
Apply relation filters to the queryset based on configured relations_filters.
|
|
@@ -335,4 +345,4 @@ class RelationFilterViewSetMixin(APIViewSet):
|
|
|
335
345
|
value = filters.get(rel_filter.query_param)
|
|
336
346
|
if value is not None:
|
|
337
347
|
rel_filters[rel_filter.query_filter] = value
|
|
338
|
-
return base_qs.filter(**rel_filters) if rel_filters else base_qs
|
|
348
|
+
return base_qs.filter(**rel_filters) if rel_filters else base_qs
|
|
File without changes
|
{django_ninja_aio_crud-2.10.0.dist-info → django_ninja_aio_crud-2.10.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|