django-ninja-aio-crud 2.16.0__py3-none-any.whl → 2.16.2__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.16.0.dist-info → django_ninja_aio_crud-2.16.2.dist-info}/METADATA +1 -1
- {django_ninja_aio_crud-2.16.0.dist-info → django_ninja_aio_crud-2.16.2.dist-info}/RECORD +7 -7
- ninja_aio/__init__.py +1 -1
- ninja_aio/exceptions.py +1 -1
- ninja_aio/models/serializers.py +17 -8
- {django_ninja_aio_crud-2.16.0.dist-info → django_ninja_aio_crud-2.16.2.dist-info}/WHEEL +0 -0
- {django_ninja_aio_crud-2.16.0.dist-info → django_ninja_aio_crud-2.16.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
ninja_aio/__init__.py,sha256=
|
|
1
|
+
ninja_aio/__init__.py,sha256=T_ERynU6iChK83VokT16riNn-rjWDvI9TKAOwaEpy68,120
|
|
2
2
|
ninja_aio/api.py,sha256=tuC7vdvn7s1GkCnSFy9Kn1zv0glZfYptRQVvo8ZRtGQ,2429
|
|
3
3
|
ninja_aio/auth.py,sha256=f4yk45fLi36Qctu0A0zgHTFedb9yk3ewq5rOMpoPYIE,9035
|
|
4
|
-
ninja_aio/exceptions.py,sha256=
|
|
4
|
+
ninja_aio/exceptions.py,sha256=w8QWmVlg88iJvBrNODSDBHSsy8nNpwngaCGWRnkXoPo,3899
|
|
5
5
|
ninja_aio/parsers.py,sha256=e_4lGCPV7zs-HTqtdJTc8yQD2KPAn9njbL8nF_Mmgkc,153
|
|
6
6
|
ninja_aio/renders.py,sha256=CW0xDa05Xna-UvL0MZqZeDEgueEaUassV_nG7Rh1-cw,1824
|
|
7
7
|
ninja_aio/types.py,sha256=E3yfXbNKkvLVcr8bvkHTSyIiCRZ4zumzJaXj1aiBi5U,735
|
|
@@ -14,7 +14,7 @@ ninja_aio/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
14
14
|
ninja_aio/helpers/api.py,sha256=va_HvZVBFm1KxwQhH4u09U4F1JS5JrQuRpRmPTHJt7w,21326
|
|
15
15
|
ninja_aio/helpers/query.py,sha256=Lqv4nrWYr543tC5K-SEcBottLID8cb83aDc26i2Wxj4,5053
|
|
16
16
|
ninja_aio/models/__init__.py,sha256=L3UQnQAlKoI3F7jinadL-Nn55hkPvnSRPYW0JtnbWFo,114
|
|
17
|
-
ninja_aio/models/serializers.py,sha256=
|
|
17
|
+
ninja_aio/models/serializers.py,sha256=yUMfVu-95EuT5wet2nwFnQlxJYSm8CFGLwKlGr6QBao,43297
|
|
18
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
|
|
@@ -24,7 +24,7 @@ ninja_aio/schemas/helpers.py,sha256=CpubwNXsZHtu8jddliyQybF1epwZ-GO60vHIuF5AR1Y,
|
|
|
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.16.
|
|
28
|
-
django_ninja_aio_crud-2.16.
|
|
29
|
-
django_ninja_aio_crud-2.16.
|
|
30
|
-
django_ninja_aio_crud-2.16.
|
|
27
|
+
django_ninja_aio_crud-2.16.2.dist-info/licenses/LICENSE,sha256=yrDAYcm0gRp_Qyzo3GQa4BjYjWRkAhGC8QRva__RYq0,1073
|
|
28
|
+
django_ninja_aio_crud-2.16.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
29
|
+
django_ninja_aio_crud-2.16.2.dist-info/METADATA,sha256=k17Ia6_VlPDH92UIsN0OQjOrj_IYOfZyffyFMbrP-xw,9964
|
|
30
|
+
django_ninja_aio_crud-2.16.2.dist-info/RECORD,,
|
ninja_aio/__init__.py
CHANGED
ninja_aio/exceptions.py
CHANGED
|
@@ -78,7 +78,7 @@ def _default_error(
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
def _pydantic_validation_error(
|
|
81
|
-
request: HttpRequest, exc:
|
|
81
|
+
request: HttpRequest, exc: PydanticValidationError, api: type[NinjaAPI]
|
|
82
82
|
) -> HttpResponse:
|
|
83
83
|
"""Translate a pydantic ValidationError into a normalized API error response."""
|
|
84
84
|
error = PydanticValidationError(exc.errors(include_input=False))
|
ninja_aio/models/serializers.py
CHANGED
|
@@ -669,9 +669,18 @@ class BaseSerializer:
|
|
|
669
669
|
customs = cls.get_custom_fields(s_type) + optionals
|
|
670
670
|
excludes = cls.get_excluded_fields(s_type)
|
|
671
671
|
|
|
672
|
-
# If no explicit fields
|
|
672
|
+
# If no explicit fields and no excludes specified
|
|
673
673
|
if not fields and not excludes:
|
|
674
|
-
|
|
674
|
+
if optionals:
|
|
675
|
+
# Use optional field names as the fields to include
|
|
676
|
+
fields = [f[0] for f in optionals]
|
|
677
|
+
elif customs:
|
|
678
|
+
# Only customs defined - exclude all model fields to prevent auto-inclusion
|
|
679
|
+
excludes = [
|
|
680
|
+
f.name
|
|
681
|
+
for f in model._meta.get_fields()
|
|
682
|
+
if getattr(f, "concrete", False)
|
|
683
|
+
]
|
|
675
684
|
|
|
676
685
|
# Only create schema if we have something to include
|
|
677
686
|
if not any([fields, customs, excludes]):
|
|
@@ -1037,18 +1046,18 @@ class SchemaModelConfig(Schema):
|
|
|
1037
1046
|
----------
|
|
1038
1047
|
fields : Optional[List[str]]
|
|
1039
1048
|
Explicit model fields to include.
|
|
1040
|
-
optionals : Optional[List[tuple[str,
|
|
1041
|
-
Optional model fields.
|
|
1049
|
+
optionals : Optional[List[tuple[str, Any]]]
|
|
1050
|
+
Optional model fields. Type can be any valid type annotation including Union.
|
|
1042
1051
|
exclude : Optional[List[str]]
|
|
1043
1052
|
Model fields to exclude.
|
|
1044
|
-
customs : Optional[List[tuple[str,
|
|
1045
|
-
Custom / synthetic fields.
|
|
1053
|
+
customs : Optional[List[tuple[str, Any, Any]]]
|
|
1054
|
+
Custom / synthetic fields. Type can be any valid type annotation including Union.
|
|
1046
1055
|
"""
|
|
1047
1056
|
|
|
1048
1057
|
fields: Optional[List[str]] = None
|
|
1049
|
-
optionals: Optional[List[tuple[str,
|
|
1058
|
+
optionals: Optional[List[tuple[str, Any]]] = None
|
|
1050
1059
|
exclude: Optional[List[str]] = None
|
|
1051
|
-
customs: Optional[List[tuple[str,
|
|
1060
|
+
customs: Optional[List[tuple[str, Any, Any]]] = None
|
|
1052
1061
|
|
|
1053
1062
|
|
|
1054
1063
|
class Serializer(BaseSerializer, metaclass=SerializerMeta):
|
|
File without changes
|
{django_ninja_aio_crud-2.16.0.dist-info → django_ninja_aio_crud-2.16.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|