django-ninja-aio-crud 2.11.1__py3-none-any.whl → 2.12.0__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.11.1.dist-info → django_ninja_aio_crud-2.12.0.dist-info}/METADATA +1 -1
- {django_ninja_aio_crud-2.11.1.dist-info → django_ninja_aio_crud-2.12.0.dist-info}/RECORD +7 -7
- ninja_aio/__init__.py +1 -1
- ninja_aio/models/serializers.py +12 -9
- ninja_aio/models/utils.py +1 -1
- {django_ninja_aio_crud-2.11.1.dist-info → django_ninja_aio_crud-2.12.0.dist-info}/WHEEL +0 -0
- {django_ninja_aio_crud-2.11.1.dist-info → django_ninja_aio_crud-2.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ninja_aio/__init__.py,sha256=
|
|
1
|
+
ninja_aio/__init__.py,sha256=vbhcy0b0GEAvlhzDMwqTW0244wyujnu_6FIEN3S3GJs,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
|
|
@@ -14,8 +14,8 @@ ninja_aio/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
14
14
|
ninja_aio/helpers/api.py,sha256=2beyexep-ehgaA_1bV5Yuh3zRDVcRCMkrW94nmfDWEA,20819
|
|
15
15
|
ninja_aio/helpers/query.py,sha256=NMGkS_v-ZVYKNtf1XohEUzfwca52Eq5FTcQ5lehHjus,4682
|
|
16
16
|
ninja_aio/models/__init__.py,sha256=L3UQnQAlKoI3F7jinadL-Nn55hkPvnSRPYW0JtnbWFo,114
|
|
17
|
-
ninja_aio/models/serializers.py,sha256=
|
|
18
|
-
ninja_aio/models/utils.py,sha256=
|
|
17
|
+
ninja_aio/models/serializers.py,sha256=uLy0FlVWw7aqr4K0UDk4In-QFGjYLL9RfPX103ApV10,38603
|
|
18
|
+
ninja_aio/models/utils.py,sha256=lAXtc3YY7_n4f0jIacX4DSXhUOzMy7y5MsBnInNxtfk,32874
|
|
19
19
|
ninja_aio/schemas/__init__.py,sha256=dHILiYBKMb51lDcyQdiXRw_0nzqM7Lu81UX2hv7kEfo,837
|
|
20
20
|
ninja_aio/schemas/api.py,sha256=dGUpJXR1iAf93QNR4kYj1uqIkTjiMfXultCotY6GtaQ,361
|
|
21
21
|
ninja_aio/schemas/filters.py,sha256=VxzH2xSWok8cUSkyfeqtrGhRewtFVmNHQfHNvY8Aynw,2662
|
|
@@ -24,7 +24,7 @@ ninja_aio/schemas/helpers.py,sha256=Vti5BfHWpxaJXj_ixZBJb34VRwhHODrlVjRlIuHh_ug,
|
|
|
24
24
|
ninja_aio/views/__init__.py,sha256=DEzjWA6y3WF0V10nNF8eEurLNEodgxKzyFd09AqVp3s,148
|
|
25
25
|
ninja_aio/views/api.py,sha256=AAqkj0xT8J3PmJvsbluZ33cfrmrXJHiV9ARe2BqnfQ8,22492
|
|
26
26
|
ninja_aio/views/mixins.py,sha256=Zl6J8gbVagwT85bzDuKyJTk3iFxxFgX0YgYkjiUxZGg,17040
|
|
27
|
-
django_ninja_aio_crud-2.
|
|
28
|
-
django_ninja_aio_crud-2.
|
|
29
|
-
django_ninja_aio_crud-2.
|
|
30
|
-
django_ninja_aio_crud-2.
|
|
27
|
+
django_ninja_aio_crud-2.12.0.dist-info/licenses/LICENSE,sha256=yrDAYcm0gRp_Qyzo3GQa4BjYjWRkAhGC8QRva__RYq0,1073
|
|
28
|
+
django_ninja_aio_crud-2.12.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
29
|
+
django_ninja_aio_crud-2.12.0.dist-info/METADATA,sha256=0SnKArx4qdFLcTE97doPAIsv7BxTPDbvTHeR6wfh-5g,9964
|
|
30
|
+
django_ninja_aio_crud-2.12.0.dist-info/RECORD,,
|
ninja_aio/__init__.py
CHANGED
ninja_aio/models/serializers.py
CHANGED
|
@@ -333,11 +333,7 @@ class BaseSerializer:
|
|
|
333
333
|
@classmethod
|
|
334
334
|
def get_fields(cls, s_type: S_TYPES):
|
|
335
335
|
"""Return explicit declared fields for the serializer type."""
|
|
336
|
-
|
|
337
|
-
# Detail schema falls back to read fields if none declared
|
|
338
|
-
if not fields and s_type == "detail":
|
|
339
|
-
return cls._get_fields("read", "fields")
|
|
340
|
-
return fields
|
|
336
|
+
return cls._get_fields(s_type, "fields")
|
|
341
337
|
|
|
342
338
|
@classmethod
|
|
343
339
|
def is_custom(cls, field: str) -> bool:
|
|
@@ -428,8 +424,9 @@ class BaseSerializer:
|
|
|
428
424
|
@classmethod
|
|
429
425
|
def _warn_missing_relation_serializer(cls, field_name: str, model) -> None:
|
|
430
426
|
"""Emit warning for reverse relations without explicit serializer mapping."""
|
|
431
|
-
if not isinstance(model, ModelSerializerMeta) and
|
|
432
|
-
settings, "NINJA_AIO_TESTING", False
|
|
427
|
+
if not isinstance(model, ModelSerializerMeta) and (
|
|
428
|
+
not getattr(settings, "NINJA_AIO_TESTING", False)
|
|
429
|
+
or getattr(settings, "NINJA_AIO_RAISE_SERIALIZATION_WARNINGS", False)
|
|
433
430
|
):
|
|
434
431
|
warnings.warn(
|
|
435
432
|
f"{cls.__name__}: reverse relation '{field_name}' is listed in read fields "
|
|
@@ -781,7 +778,10 @@ class ModelSerializer(models.Model, BaseSerializer, metaclass=ModelSerializerMet
|
|
|
781
778
|
if not config_class_name:
|
|
782
779
|
return []
|
|
783
780
|
config_class = getattr(cls, config_class_name)
|
|
784
|
-
|
|
781
|
+
fields = getattr(config_class, f_type, [])
|
|
782
|
+
if not fields and s_type == "detail":
|
|
783
|
+
fields = getattr(cls.ReadSerializer, f_type, [])
|
|
784
|
+
return fields
|
|
785
785
|
|
|
786
786
|
@classmethod
|
|
787
787
|
def _get_model(cls) -> "ModelSerializer":
|
|
@@ -1006,7 +1006,10 @@ class Serializer(BaseSerializer, metaclass=SerializerMeta):
|
|
|
1006
1006
|
return []
|
|
1007
1007
|
schema = cls._get_schema_meta(schema_key)
|
|
1008
1008
|
if not schema:
|
|
1009
|
-
|
|
1009
|
+
if s_type == "detail":
|
|
1010
|
+
schema = cls._get_schema_meta("out")
|
|
1011
|
+
else:
|
|
1012
|
+
return []
|
|
1010
1013
|
return getattr(schema, f_type, []) or []
|
|
1011
1014
|
|
|
1012
1015
|
@classmethod
|
ninja_aio/models/utils.py
CHANGED
|
@@ -601,7 +601,7 @@ class ModelUtil:
|
|
|
601
601
|
async def _bump_object_from_schema(
|
|
602
602
|
self, obj: type["ModelSerializer"] | models.Model, schema: Schema
|
|
603
603
|
):
|
|
604
|
-
return (await sync_to_async(schema.from_orm)(obj)).model_dump(
|
|
604
|
+
return (await sync_to_async(schema.from_orm)(obj)).model_dump()
|
|
605
605
|
|
|
606
606
|
def _validate_read_params(self, request: HttpRequest, query_data: QuerySchema):
|
|
607
607
|
"""Validate required parameters for read operations."""
|
|
File without changes
|
{django_ninja_aio_crud-2.11.1.dist-info → django_ninja_aio_crud-2.12.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|