django-ninja-aio-crud 0.7.1__tar.gz → 0.7.2__tar.gz

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.1
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,6 +1,6 @@
1
1
  """Django Ninja AIO CRUD - Rest Framework"""
2
2
 
3
- __version__ = "0.7.1"
3
+ __version__ = "0.7.2"
4
4
 
5
5
  from .api import NinjaAIO
6
6
 
@@ -431,7 +431,8 @@ 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
-
434
+ if not isinstance(rel_obj, ModelSerializerMeta):
435
+ continue
435
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)
@@ -441,6 +442,9 @@ class ModelSerializer(models.Model, metaclass=ModelSerializerMeta):
441
442
  field_obj, (ForwardOneToOneDescriptor, ForwardManyToOneDescriptor)
442
443
  ):
443
444
  rel_obj = field_obj.field.related_model
445
+ if not isinstance(rel_obj, ModelSerializerMeta):
446
+ fields.append(f)
447
+ continue
444
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)