kodexa 7.0.11485322210__py3-none-any.whl → 7.0.11592436555__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.
- kodexa/model/model.py +6 -6
- kodexa/model/objects.py +10 -2
- kodexa/model/persistence.py +2 -2
- {kodexa-7.0.11485322210.dist-info → kodexa-7.0.11592436555.dist-info}/METADATA +1 -1
- {kodexa-7.0.11485322210.dist-info → kodexa-7.0.11592436555.dist-info}/RECORD +7 -7
- {kodexa-7.0.11485322210.dist-info → kodexa-7.0.11592436555.dist-info}/LICENSE +0 -0
- {kodexa-7.0.11485322210.dist-info → kodexa-7.0.11592436555.dist-info}/WHEEL +0 -0
kodexa/model/model.py
CHANGED
@@ -299,12 +299,6 @@ class ContentNode(object):
|
|
299
299
|
def set_content_parts(self, content_parts):
|
300
300
|
self.document.get_persistence().update_content_parts(self, content_parts)
|
301
301
|
|
302
|
-
def get_validations(self) -> list[DocumentTaxonValidation]:
|
303
|
-
return self.document.get_persistence().get_validations()
|
304
|
-
|
305
|
-
def set_validations(self, validations: list[DocumentTaxonValidation]):
|
306
|
-
self.document.get_persistence().set_validations(validations)
|
307
|
-
|
308
302
|
def update(self):
|
309
303
|
"""
|
310
304
|
Update this node in the document persistence
|
@@ -2436,6 +2430,12 @@ class Document(object):
|
|
2436
2430
|
def __str__(self):
|
2437
2431
|
return f"kodexa://{self.uuid}"
|
2438
2432
|
|
2433
|
+
def get_validations(self) -> list[DocumentTaxonValidation]:
|
2434
|
+
return self.get_persistence().get_validations()
|
2435
|
+
|
2436
|
+
def set_validations(self, validations: list[DocumentTaxonValidation]):
|
2437
|
+
self.get_persistence().set_validations(validations)
|
2438
|
+
|
2439
2439
|
def add_exception(self, exception: ContentException):
|
2440
2440
|
self._persistence_layer.add_exception(exception)
|
2441
2441
|
|
kodexa/model/objects.py
CHANGED
@@ -2583,7 +2583,7 @@ class TaxonGuideProperties(BaseModel):
|
|
2583
2583
|
guidance_key: Optional[bool] = Field(None, alias="guidanceKey")
|
2584
2584
|
guidance_key_expression: Optional[str] = Field(None, alias="guidanceKeyExpression")
|
2585
2585
|
use_guidance_for_classification: Optional[bool] = Field(None, alias="useGuidanceForClassification")
|
2586
|
-
|
2586
|
+
if_present_required: Optional[bool] = Field(None, alias="ifPresentRequired")
|
2587
2587
|
|
2588
2588
|
class TaxonConditionalFormat(BaseModel):
|
2589
2589
|
type: Optional[str] = None
|
@@ -2610,7 +2610,15 @@ class TaxonValidation(BaseModel):
|
|
2610
2610
|
overridable: Optional[bool] = None
|
2611
2611
|
|
2612
2612
|
|
2613
|
-
class DocumentTaxonValidation:
|
2613
|
+
class DocumentTaxonValidation(BaseModel):
|
2614
|
+
|
2615
|
+
model_config = ConfigDict(
|
2616
|
+
populate_by_name=True,
|
2617
|
+
use_enum_values=True,
|
2618
|
+
arbitrary_types_allowed=True,
|
2619
|
+
protected_namespaces=("model_config",),
|
2620
|
+
)
|
2621
|
+
|
2614
2622
|
taxonomy_ref: Optional[str] = Field(None, alias="taxonomyRef")
|
2615
2623
|
taxon_path: Optional[str] = Field(None, alias="taxonPath")
|
2616
2624
|
validation: Optional[TaxonValidation] = None
|
kodexa/model/persistence.py
CHANGED
@@ -1163,7 +1163,7 @@ class SqliteDocumentPersistence(object):
|
|
1163
1163
|
validations (List[DocumentTaxonValidation]): The validations to store.
|
1164
1164
|
"""
|
1165
1165
|
self.__ensure_validations_table_exists()
|
1166
|
-
serialized_data = sqlite3.Binary(msgpack.packb([v.
|
1166
|
+
serialized_data = sqlite3.Binary(msgpack.packb([v.model_dump(by_alias=True) for v in validations]))
|
1167
1167
|
self.cursor.execute("UPDATE validations SET obj = ? WHERE rowid = 1", [serialized_data])
|
1168
1168
|
self.connection.commit()
|
1169
1169
|
|
@@ -1177,7 +1177,7 @@ class SqliteDocumentPersistence(object):
|
|
1177
1177
|
self.__ensure_validations_table_exists()
|
1178
1178
|
result = self.cursor.execute("SELECT obj FROM validations WHERE rowid = 1").fetchone()
|
1179
1179
|
if result and result[0]:
|
1180
|
-
return [DocumentTaxonValidation(
|
1180
|
+
return [DocumentTaxonValidation.model_validate(v) for v in msgpack.unpackb(result[0])]
|
1181
1181
|
return []
|
1182
1182
|
|
1183
1183
|
def set_external_data(self, external_data: dict):
|
@@ -11,9 +11,9 @@ kodexa/model/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
11
11
|
kodexa/model/entities/check_response.py,sha256=eqBHxO6G2OAziL3p9bHGI-oiPkAG82H6Choc8wyvtM4,3949
|
12
12
|
kodexa/model/entities/product.py,sha256=ZDpHuBE_9FJ-klnkyBvTfPwYOqBkM1wraZMtHqNA8FQ,3526
|
13
13
|
kodexa/model/entities/product_subscription.py,sha256=UcmWR-qgLfdV7VCtJNwzgkanoS8nBSL6ngVuxQUK1M8,3810
|
14
|
-
kodexa/model/model.py,sha256=
|
15
|
-
kodexa/model/objects.py,sha256=
|
16
|
-
kodexa/model/persistence.py,sha256=
|
14
|
+
kodexa/model/model.py,sha256=wY5HnpsAnKlH_aDEHWNf-ZrhdrBg-DtqGFszjkdZtPU,118340
|
15
|
+
kodexa/model/objects.py,sha256=Mr88zAD8JhlcO5Rv6VC8meNLfmWP8itfoonolbsLenk,185232
|
16
|
+
kodexa/model/persistence.py,sha256=PTh9jmqYCDuWfiuCssLttFaYWiMA_fCiwjgsYDW4AhE,68281
|
17
17
|
kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
|
18
18
|
kodexa/pipeline/pipeline.py,sha256=ZYpJAWcwV4YRK589DUhU0vXGQlkNSj4J2TsGbYqTLjo,25221
|
19
19
|
kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
|
@@ -42,7 +42,7 @@ kodexa/testing/test_utils.py,sha256=DrLCkHxdb6AbZ-X3WmTMbQmnVIm55VEBL8MjtUK9POs,
|
|
42
42
|
kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
|
43
43
|
kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
44
|
kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
|
45
|
-
kodexa-7.0.
|
46
|
-
kodexa-7.0.
|
47
|
-
kodexa-7.0.
|
48
|
-
kodexa-7.0.
|
45
|
+
kodexa-7.0.11592436555.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
46
|
+
kodexa-7.0.11592436555.dist-info/METADATA,sha256=7wrSWqgQFmqzFiXW9CS50pBcNSA6yX58NJaIzAiGJwE,3529
|
47
|
+
kodexa-7.0.11592436555.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
48
|
+
kodexa-7.0.11592436555.dist-info/RECORD,,
|
File without changes
|
File without changes
|