nsj-rest-lib2 0.0.12__tar.gz → 0.0.13__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.
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/PKG-INFO +1 -1
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/property_compiler.py +63 -26
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2.egg-info/PKG-INFO +1 -1
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/setup.cfg +1 -1
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/README.md +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/ai_compiler.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/compiler.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/compiler_structures.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/dto_compiler.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/ai_entity_edl.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/api_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/column_meta_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/entity_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/index_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/primitives.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/property_meta_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/repository_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/trait_property_meta_model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/entity_compiler.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/model.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/util/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/util/str_util.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/util/type_naming_util.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/util/type_util.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/controller/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/controller/dynamic_controller.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/exception.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/redis_config.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/service/__init__.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/service/entity_loader.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/settings.py +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2.egg-info/SOURCES.txt +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2.egg-info/dependency_links.txt +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2.egg-info/requires.txt +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2.egg-info/top_level.txt +0 -0
- {nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nsj_rest_lib2
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Summary: Biblioteca para permitir a distribuição de rotas dinâmicas numa API, configuradas por meio de EDLs declarativos (em formato JSON).
|
|
5
5
|
Home-page: https://github.com/Nasajon/nsj_rest_lib2
|
|
6
6
|
Author: Nasajon Sistemas
|
|
@@ -117,6 +117,7 @@ class EDLPropertyCompiler:
|
|
|
117
117
|
entity_models,
|
|
118
118
|
properties_structure,
|
|
119
119
|
ast_dto_attributes,
|
|
120
|
+
ast_entity_attributes,
|
|
120
121
|
related_imports,
|
|
121
122
|
relations_dependencies,
|
|
122
123
|
pkey,
|
|
@@ -353,6 +354,7 @@ class EDLPropertyCompiler:
|
|
|
353
354
|
entity_models: dict[str, EntityModel],
|
|
354
355
|
properties_structure: PropertiesCompilerStructure,
|
|
355
356
|
ast_dto_attributes: list[ast.stmt],
|
|
357
|
+
ast_entity_attributes: list[ast.stmt],
|
|
356
358
|
related_imports: list[tuple[str, str, str]],
|
|
357
359
|
relations_dependencies: list[RelationDependency],
|
|
358
360
|
pkey: str,
|
|
@@ -418,6 +420,7 @@ class EDLPropertyCompiler:
|
|
|
418
420
|
self._build_ast_1_1(
|
|
419
421
|
properties_structure,
|
|
420
422
|
ast_dto_attributes,
|
|
423
|
+
ast_entity_attributes,
|
|
421
424
|
pkey,
|
|
422
425
|
related_dto_class_name,
|
|
423
426
|
related_entity_class_name,
|
|
@@ -490,6 +493,7 @@ class EDLPropertyCompiler:
|
|
|
490
493
|
self,
|
|
491
494
|
properties_structure: PropertiesCompilerStructure,
|
|
492
495
|
ast_dto_attributes: list[ast.stmt],
|
|
496
|
+
ast_entity_attributes: list[ast.stmt],
|
|
493
497
|
pkey: str,
|
|
494
498
|
related_dto_class_name: str,
|
|
495
499
|
related_entity_class_name: str,
|
|
@@ -539,7 +543,18 @@ class EDLPropertyCompiler:
|
|
|
539
543
|
),
|
|
540
544
|
)
|
|
541
545
|
)
|
|
546
|
+
else:
|
|
547
|
+
# Adicionando propriedade, para o campo de relação, no DTO (quando for o dono da relação)
|
|
548
|
+
ast_dto_attributes.append(
|
|
549
|
+
self._build_dto_property_ast(relation_column, PrimitiveTypes.UUID)
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
# Adicionando propriedade, para o campo de relação, no Entity (quando for o dono da relação)
|
|
553
|
+
ast_entity_attributes.append(
|
|
554
|
+
self._build_entity_property_ast(relation_column, PrimitiveTypes.UUID)
|
|
555
|
+
)
|
|
542
556
|
|
|
557
|
+
# Adicionando a propriedade em si do relacionamento, no DTO
|
|
543
558
|
ast_attr = ast.AnnAssign(
|
|
544
559
|
target=ast.Name(id=CompilerStrUtil.to_snake_case(pkey), ctx=ast.Store()),
|
|
545
560
|
annotation=ast.Name(
|
|
@@ -556,6 +571,52 @@ class EDLPropertyCompiler:
|
|
|
556
571
|
|
|
557
572
|
ast_dto_attributes.append(ast_attr)
|
|
558
573
|
|
|
574
|
+
def _build_dto_property_ast(
|
|
575
|
+
self,
|
|
576
|
+
name: str,
|
|
577
|
+
type: PrimitiveTypes | str,
|
|
578
|
+
keywords: list[ast.keyword] = [],
|
|
579
|
+
):
|
|
580
|
+
if isinstance(type, PrimitiveTypes):
|
|
581
|
+
type_str = TypeUtil.property_type_to_python_type(type)
|
|
582
|
+
else:
|
|
583
|
+
type_str = type
|
|
584
|
+
|
|
585
|
+
return ast.AnnAssign(
|
|
586
|
+
target=ast.Name(
|
|
587
|
+
id=CompilerStrUtil.to_snake_case(name),
|
|
588
|
+
ctx=ast.Store(),
|
|
589
|
+
),
|
|
590
|
+
annotation=ast.Name(
|
|
591
|
+
id=type_str,
|
|
592
|
+
ctx=ast.Load(),
|
|
593
|
+
),
|
|
594
|
+
value=ast.Call(
|
|
595
|
+
func=ast.Name(id="DTOField", ctx=ast.Load()),
|
|
596
|
+
args=[],
|
|
597
|
+
keywords=keywords,
|
|
598
|
+
),
|
|
599
|
+
simple=1,
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
def _build_entity_property_ast(
|
|
603
|
+
self,
|
|
604
|
+
name: str,
|
|
605
|
+
type: PrimitiveTypes,
|
|
606
|
+
):
|
|
607
|
+
return ast.AnnAssign(
|
|
608
|
+
target=ast.Name(
|
|
609
|
+
id=CompilerStrUtil.to_snake_case(name),
|
|
610
|
+
ctx=ast.Store(),
|
|
611
|
+
),
|
|
612
|
+
annotation=ast.Name(
|
|
613
|
+
id=TypeUtil.property_type_to_python_type(type),
|
|
614
|
+
ctx=ast.Load(),
|
|
615
|
+
),
|
|
616
|
+
value=ast.Constant(value=None),
|
|
617
|
+
simple=1,
|
|
618
|
+
)
|
|
619
|
+
|
|
559
620
|
def _compile_simple_property(
|
|
560
621
|
self,
|
|
561
622
|
properties_structure,
|
|
@@ -766,35 +827,11 @@ class EDLPropertyCompiler:
|
|
|
766
827
|
else:
|
|
767
828
|
prop_type = TypeUtil.property_type_to_python_type(prop.type)
|
|
768
829
|
|
|
769
|
-
ast_attr =
|
|
770
|
-
target=ast.Name(id=CompilerStrUtil.to_snake_case(pkey), ctx=ast.Store()),
|
|
771
|
-
annotation=ast.Name(
|
|
772
|
-
id=prop_type,
|
|
773
|
-
ctx=ast.Load(),
|
|
774
|
-
),
|
|
775
|
-
value=ast.Call(
|
|
776
|
-
func=ast.Name(id="DTOField", ctx=ast.Load()),
|
|
777
|
-
args=[],
|
|
778
|
-
keywords=keywords,
|
|
779
|
-
),
|
|
780
|
-
simple=1,
|
|
781
|
-
)
|
|
782
|
-
|
|
830
|
+
ast_attr = self._build_dto_property_ast(pkey, prop_type, keywords)
|
|
783
831
|
ast_dto_attributes.append(ast_attr)
|
|
784
832
|
|
|
785
833
|
# Entity
|
|
786
|
-
ast_entity_attr =
|
|
787
|
-
target=ast.Name(
|
|
788
|
-
id=CompilerStrUtil.to_snake_case(entity_field_name),
|
|
789
|
-
ctx=ast.Store(),
|
|
790
|
-
),
|
|
791
|
-
annotation=ast.Name(
|
|
792
|
-
id=TypeUtil.property_type_to_python_type(prop.type),
|
|
793
|
-
ctx=ast.Load(),
|
|
794
|
-
),
|
|
795
|
-
value=ast.Constant(value=None),
|
|
796
|
-
simple=1,
|
|
797
|
-
)
|
|
834
|
+
ast_entity_attr = self._build_entity_property_ast(entity_field_name, prop.type)
|
|
798
835
|
|
|
799
836
|
ast_entity_attributes.append(ast_entity_attr)
|
|
800
837
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nsj_rest_lib2
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Summary: Biblioteca para permitir a distribuição de rotas dinâmicas numa API, configuradas por meio de EDLs declarativos (em formato JSON).
|
|
5
5
|
Home-page: https://github.com/Nasajon/nsj_rest_lib2
|
|
6
6
|
Author: Nasajon Sistemas
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = nsj_rest_lib2
|
|
3
|
-
version = 0.0.
|
|
3
|
+
version = 0.0.13
|
|
4
4
|
author = Nasajon Sistemas
|
|
5
5
|
author_email = contact.dev@nasajon.com.br
|
|
6
6
|
description = Biblioteca para permitir a distribuição de rotas dinâmicas numa API, configuradas por meio de EDLs declarativos (em formato JSON).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/ai_entity_edl.py
RENAMED
|
File without changes
|
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/column_meta_model.py
RENAMED
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/entity_model.py
RENAMED
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/index_model.py
RENAMED
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/primitives.py
RENAMED
|
File without changes
|
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/edl_model/repository_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/compiler/util/type_naming_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nsj_rest_lib2-0.0.12 → nsj_rest_lib2-0.0.13}/nsj_rest_lib2/controller/dynamic_controller.py
RENAMED
|
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
|