django-ninja-aio-crud 0.10.1__tar.gz → 0.10.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.4
2
2
  Name: django-ninja-aio-crud
3
- Version: 0.10.1
3
+ Version: 0.10.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.10.1"
3
+ __version__ = "0.10.2"
4
4
 
5
5
  from .api import NinjaAIO
6
6
 
@@ -499,3 +499,24 @@ class APIViewSet:
499
499
  manage_related.__name__ = (
500
500
  f"manage_{self.model_util.model_name}_{rel_path}"
501
501
  )
502
+
503
+ def _add_views(self):
504
+ if "all" in self.disable:
505
+ if self.m2m_relations:
506
+ self._m2m_views()
507
+ self.views()
508
+ return self.router
509
+
510
+ for views_type, (schema, view) in self._crud_views.items():
511
+ if views_type not in self.disable and (
512
+ schema is not None or views_type == "delete"
513
+ ):
514
+ view()
515
+
516
+ self.views()
517
+ if self.m2m_relations:
518
+ self._m2m_views()
519
+ return self.router
520
+
521
+ def add_views_to_route(self):
522
+ return self.api.add_router(f"{self.api_route_path}", self._add_views())