easyapi-django 0.22__tar.gz → 0.23__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.
Files changed (25) hide show
  1. {easyapi_django-0.22/easyapi_django.egg-info → easyapi_django-0.23}/PKG-INFO +1 -1
  2. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/base.py +13 -9
  3. {easyapi_django-0.22 → easyapi_django-0.23/easyapi_django.egg-info}/PKG-INFO +1 -1
  4. {easyapi_django-0.22 → easyapi_django-0.23}/pyproject.toml +1 -1
  5. {easyapi_django-0.22 → easyapi_django-0.23}/LICENSE +0 -0
  6. {easyapi_django-0.22 → easyapi_django-0.23}/README.md +0 -0
  7. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/__init__.py +0 -0
  8. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/calc.py +0 -0
  9. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/calc_resource.py +0 -0
  10. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/constants.py +0 -0
  11. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/dates.py +0 -0
  12. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/exception.py +0 -0
  13. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/filters.py +0 -0
  14. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/middleware.py +0 -0
  15. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/orm/__init__.py +0 -0
  16. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/rate_limit.py +0 -0
  17. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/routes.py +0 -0
  18. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/__init__.py +0 -0
  19. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/db_router.py +0 -0
  20. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/tenant.py +0 -0
  21. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/util.py +0 -0
  22. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/SOURCES.txt +0 -0
  23. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/dependency_links.txt +0 -0
  24. {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/top_level.txt +0 -0
  25. {easyapi_django-0.22 → easyapi_django-0.23}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easyapi_django
3
- Version: 0.22
3
+ Version: 0.23
4
4
  Summary: A simple rest api generator for django based on models
5
5
  Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
6
6
  Project-URL: Homepage, https://github.com/ssjunior/easyapi-django
@@ -268,10 +268,10 @@ class BaseResource(View):
268
268
  self.m2m_fields.append(field.name)
269
269
  continue
270
270
 
271
- if field.concrete and field.many_to_one:
272
- self.fk_fields.append(field.name)
273
- fields.append(f'{field.name}_id')
274
- continue
271
+ # if field.concrete and field.many_to_one:
272
+ # self.fk_fields.append(field.name)
273
+ # fields.append(f'{field.name}_id')
274
+ # continue
275
275
 
276
276
  # if not field.concrete and field.one_to_many:
277
277
  # self.related_fields.append(field.name)
@@ -902,11 +902,11 @@ class BaseResource(View):
902
902
 
903
903
  if self.edit_related_fields:
904
904
  for key in self.edit_related_fields.keys():
905
- if key in self.fk_fields:
906
- related.append(key)
907
-
908
- elif key in self.m2m_fields:
905
+ if key in self.m2m_fields:
909
906
  m2m.append(key)
907
+ else:
908
+ # Adiciona tudo que não é M2M (FKs diretos e encadeados)
909
+ related.append(key)
910
910
 
911
911
  for key in related:
912
912
  for rf in self.edit_related_fields[key]:
@@ -917,8 +917,12 @@ class BaseResource(View):
917
917
  else:
918
918
  related_fields.append(key)
919
919
 
920
- self.queryset = self.queryset.select_related(*related_fields)
920
+ try:
921
+ self.queryset = self.queryset.select_related(*related_fields)
922
+ except Exception as e:
923
+ raise HTTPException(500, f'Invalid related field in edit_related_fields: {str(e)}')
921
924
 
925
+ print(related_fields)
922
926
  prefetch_fields = self.edit_prefetch_related.keys() if self.edit_prefetch_related else []
923
927
  if prefetch_fields:
924
928
  self.queryset = self.queryset.prefetch_related(*prefetch_fields)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easyapi_django
3
- Version: 0.22
3
+ Version: 0.23
4
4
  Summary: A simple rest api generator for django based on models
5
5
  Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
6
6
  Project-URL: Homepage, https://github.com/ssjunior/easyapi-django
@@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"
11
11
 
12
12
  [project]
13
13
  name = "easyapi_django"
14
- version = "0.22"
14
+ version = "0.23"
15
15
  authors = [
16
16
  { name="Stamatios Stamou Jr", email="bushier.outsets.0c@icloud.com" },
17
17
  ]
File without changes
File without changes
File without changes