django-ninja-aio-crud 0.7.0__py3-none-any.whl → 0.7.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: django-ninja-aio-crud
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: Django Ninja AIO CRUD - Rest Framework
5
5
  Author: Giuseppe Casillo
6
6
  Requires-Python: >=3.10
@@ -1,13 +1,13 @@
1
- ninja_aio/__init__.py,sha256=0hUbl6e46JSJW76-kB74s2Vu6nXYrv6r9Jaq_ihI3SQ,119
1
+ ninja_aio/__init__.py,sha256=JoQLorChXFbDL3NJNUxXJK3CvLwiBxfYk33tCvG88Uw,119
2
2
  ninja_aio/api.py,sha256=Fe6l3YCy7MW5TY4-Lbl80CFuK2NT2Y7tHfmqPk6Mqak,1735
3
3
  ninja_aio/auth.py,sha256=fKboioU4sezPukKJukIwiboxml_KV7irhCH3vGYt5pU,1008
4
4
  ninja_aio/exceptions.py,sha256=gPnZX1Do2GXudbU8wDYkwhO70Qj0ZNrIJJ2UXRs9vYk,2241
5
- ninja_aio/models.py,sha256=R_CrpLlwEQjR10VBTIt8YStzOwBHfhuo1E_xFSNxlrE,17628
5
+ ninja_aio/models.py,sha256=hBC5j10yFfDBcJ_UkJHYpW4Zg5r7thk6NuVYPAscMnk,17854
6
6
  ninja_aio/parsers.py,sha256=e_4lGCPV7zs-HTqtdJTc8yQD2KPAn9njbL8nF_Mmgkc,153
7
7
  ninja_aio/renders.py,sha256=mHeKNJtmDhZmgFpS9B6SPn5uZFcyVXrsoMhr149LeW8,1555
8
8
  ninja_aio/schemas.py,sha256=EgRkfhnzZqwGvdBmqlZixMtMcoD1ZxV_qzJ3fmaAy20,113
9
9
  ninja_aio/types.py,sha256=EHznS-6KWLwSX5hLeXbAi7qHWla09_rGeQraiLpH-aY,491
10
10
  ninja_aio/views.py,sha256=qROag0OsMeVUXcnUYKV7ZmWj4E0F-QH52PI2-56zVRs,9263
11
- django_ninja_aio_crud-0.7.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
12
- django_ninja_aio_crud-0.7.0.dist-info/METADATA,sha256=bo1TL2NTpz3T3vsh0aPw_fpcrR5GUx1qqB36S6-HECY,13737
13
- django_ninja_aio_crud-0.7.0.dist-info/RECORD,,
11
+ django_ninja_aio_crud-0.7.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
12
+ django_ninja_aio_crud-0.7.2.dist-info/METADATA,sha256=ukl29NR99otzFVi0RUglUnRTg1NoVGNpqoKbGJMVIeY,13737
13
+ django_ninja_aio_crud-0.7.2.dist-info/RECORD,,
ninja_aio/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Django Ninja AIO CRUD - Rest Framework"""
2
2
 
3
- __version__ = "0.7.0"
3
+ __version__ = "0.7.2"
4
4
 
5
5
  from .api import NinjaAIO
6
6
 
ninja_aio/models.py CHANGED
@@ -431,8 +431,9 @@ class ModelSerializer(models.Model, metaclass=ModelSerializerMeta):
431
431
  else: # ReverseOneToOneDescriptor
432
432
  rel_obj = field_obj.related.related_model
433
433
  rel_type = "one"
434
-
435
- if not rel_obj.get_fields("read") or not rel_obj.get_custom_fields("read"):
434
+ if not isinstance(rel_obj, ModelSerializerMeta):
435
+ continue
436
+ if not rel_obj.get_fields("read") and not rel_obj.get_custom_fields("read"):
436
437
  continue
437
438
  rel_data = cls.get_reverse_relation_schema(rel_obj, rel_type, f)
438
439
  reverse_rels.append(rel_data)
@@ -441,7 +442,10 @@ class ModelSerializer(models.Model, metaclass=ModelSerializerMeta):
441
442
  field_obj, (ForwardOneToOneDescriptor, ForwardManyToOneDescriptor)
442
443
  ):
443
444
  rel_obj = field_obj.field.related_model
444
- if not rel_obj.get_fields("read") or not rel_obj.get_custom_fields("read"):
445
+ if not isinstance(rel_obj, ModelSerializerMeta):
446
+ fields.append(f)
447
+ continue
448
+ if not rel_obj.get_fields("read") and not rel_obj.get_custom_fields("read"):
445
449
  continue
446
450
  rel_data = cls.get_forward_relation_schema(rel_obj, f)
447
451
  rels.append(rel_data)