django-ninja-aio-crud 0.7.6__tar.gz → 0.7.8__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.7.6
3
+ Version: 0.7.8
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.6"
3
+ __version__ = "0.7.8"
4
4
 
5
5
  from .api import NinjaAIO
6
6
 
@@ -142,7 +142,7 @@ class ModelUtil:
142
142
  ):
143
143
  rel_util = ModelUtil(field_obj.related_model)
144
144
  rel: ModelSerializer = await rel_util.get_object(
145
- request, list(v.values())[0], with_qs_request=False
145
+ request, list(v.values())[0]
146
146
  )
147
147
  if isinstance(field_obj, models.ForeignKey):
148
148
  for rel_k, rel_v in v.items():
@@ -75,6 +75,7 @@ class APIViewSet:
75
75
  pagination_class: type[AsyncPaginationBase] = PageNumberPagination
76
76
  query_params: dict[str, tuple[type, ...]] = {}
77
77
  disable: list[type[VIEW_TYPES]] = []
78
+ api_route_path: str = ""
78
79
 
79
80
  def __init__(self) -> None:
80
81
  self.error_codes = ERROR_CODES
@@ -86,6 +87,9 @@ class APIViewSet:
86
87
  self.router = Router(tags=[self.router_tag])
87
88
  self.path = "/"
88
89
  self.path_retrieve = f"{{{self.model_util.model_pk_name}}}/"
90
+ self.api_route_path = (
91
+ self.api_route_path or self.model_util.verbose_name_path_resolver()
92
+ )
89
93
 
90
94
  @property
91
95
  def _crud_views(self):
@@ -266,6 +270,6 @@ class APIViewSet:
266
270
 
267
271
  def add_views_to_route(self):
268
272
  return self.api.add_router(
269
- f"{self.model_util.verbose_name_path_resolver()}/",
273
+ f"{self.api_route_path}/",
270
274
  self.add_views(),
271
275
  )