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.
- {easyapi_django-0.22/easyapi_django.egg-info → easyapi_django-0.23}/PKG-INFO +1 -1
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/base.py +13 -9
- {easyapi_django-0.22 → easyapi_django-0.23/easyapi_django.egg-info}/PKG-INFO +1 -1
- {easyapi_django-0.22 → easyapi_django-0.23}/pyproject.toml +1 -1
- {easyapi_django-0.22 → easyapi_django-0.23}/LICENSE +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/README.md +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/__init__.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/calc.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/calc_resource.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/constants.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/dates.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/exception.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/filters.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/middleware.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/orm/__init__.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/rate_limit.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/routes.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/__init__.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/db_router.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/tenant/tenant.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi/util.py +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/SOURCES.txt +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/dependency_links.txt +0 -0
- {easyapi_django-0.22 → easyapi_django-0.23}/easyapi_django.egg-info/top_level.txt +0 -0
- {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.
|
|
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
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|