industrial-model 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl

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: industrial-model
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Industrial Model ORM
5
5
  Author-email: Lucas Alves <lucasrosaalves@gmail.com>
6
6
  Classifier: Programming Language :: Python
@@ -81,7 +81,27 @@ class Country(ViewInstance):
81
81
  class Person(ViewInstance):
82
82
  name: str
83
83
  birthday: datetime.date
84
- livesIn: Country
84
+ lives_in: Country
85
+ cars: list[Car]
86
+
87
+
88
+ # By default, the ORM maps the class name to the view in the data model.
89
+ # You can override this behavior using the `view_config` field.
90
+
91
+ # For improved query performance, you can configure `instance_spaces` or `instance_spaces_prefix`
92
+ # in the `view_config`. These options include space filters in the generated queries,
93
+ # which can significantly reduce response times when working with large datasets.
94
+
95
+ class AnotherPerson(ViewInstance):
96
+ view_config = ViewInstanceConfig(
97
+ view_external_id="Person", # Maps this class to the 'Person' view
98
+ instance_spaces_prefix="Industr-", # Filters queries to spaces with this prefix
99
+ instance_spaces=["Industrial-Data"] # Alternatively, explicitly filter by these spaces
100
+ )
101
+
102
+ name: str
103
+ birthday: datetime.date
104
+ lives_in: Country
85
105
  cars: list[Car]
86
106
 
87
107
 
@@ -128,9 +148,9 @@ result = engine.query(statement)
128
148
  # 4. Nested filtering using relationships
129
149
  statement = select(Person).where(
130
150
  or_(
131
- col(Person.livesIn).nested_(Country.name == "usa"),
151
+ col(Person.lives_in).nested_(Country.name == "usa"),
132
152
  and_(
133
- col(Person.livesIn).nested_(col(Country.name).equals_("bra")),
153
+ col(Person.lives_in).nested_(col(Country.name).equals_("bra")),
134
154
  col(Person.birthday).equals_("2023-01-01")
135
155
  )
136
156
  )
@@ -23,6 +23,6 @@ industrial_model/queries/models.py,sha256=iiHQ7-cfg0nukEv5PoCx9QPF-w1gVSnoNbXBOK
23
23
  industrial_model/queries/params.py,sha256=ehgCoR5n6E-tkEuoymZ2lkLcSzMaBAx_HnyJ7sWpqz0,964
24
24
  industrial_model/statements/__init__.py,sha256=mqPIvfQ-XZ_IILwha7RbkdIKH_MRAdAvfrw80pCKU1c,1753
25
25
  industrial_model/statements/expressions.py,sha256=bsUnkFDGVHpOQ1RUtEbSPE1nfVkF0zC3m5-9JFkSqu8,4751
26
- industrial_model-0.1.3.dist-info/METADATA,sha256=3DmP5yMReiv2zFlknqgEo6hCLMoIwQDNGX0e_wqN0KE,3935
27
- industrial_model-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- industrial_model-0.1.3.dist-info/RECORD,,
26
+ industrial_model-0.1.4.dist-info/METADATA,sha256=zJFOaUlsd7sEzyZDxNXRF7Lj80DfHA2kSGHrAc3HvQA,4806
27
+ industrial_model-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ industrial_model-0.1.4.dist-info/RECORD,,