xplan-tools 1.12.0__py3-none-any.whl → 1.12.1__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.
- xplan_tools/model/base.py +20 -2
- {xplan_tools-1.12.0.dist-info → xplan_tools-1.12.1.dist-info}/METADATA +1 -1
- {xplan_tools-1.12.0.dist-info → xplan_tools-1.12.1.dist-info}/RECORD +6 -6
- {xplan_tools-1.12.0.dist-info → xplan_tools-1.12.1.dist-info}/WHEEL +0 -0
- {xplan_tools-1.12.0.dist-info → xplan_tools-1.12.1.dist-info}/entry_points.txt +0 -0
- {xplan_tools-1.12.0.dist-info → xplan_tools-1.12.1.dist-info}/licenses/LICENSE.md +0 -0
xplan_tools/model/base.py
CHANGED
|
@@ -7,7 +7,17 @@ import datetime
|
|
|
7
7
|
import logging
|
|
8
8
|
import re
|
|
9
9
|
from types import NoneType
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import (
|
|
11
|
+
Any,
|
|
12
|
+
Iterator,
|
|
13
|
+
Literal,
|
|
14
|
+
Optional,
|
|
15
|
+
Self,
|
|
16
|
+
Tuple,
|
|
17
|
+
Type,
|
|
18
|
+
get_args,
|
|
19
|
+
get_origin,
|
|
20
|
+
)
|
|
11
21
|
from uuid import UUID
|
|
12
22
|
|
|
13
23
|
from lxml.etree import _Element
|
|
@@ -433,7 +443,7 @@ class BaseFeature(BaseModel, GMLAdapter, CoretableAdapter, JsonFGAdapter):
|
|
|
433
443
|
|
|
434
444
|
@model_validator(mode="before")
|
|
435
445
|
@classmethod
|
|
436
|
-
def
|
|
446
|
+
def _deserialization_hook(cls, data: Any, info: ValidationInfo) -> Any:
|
|
437
447
|
"""Provides deserialization for different formats/representations before validation."""
|
|
438
448
|
if isinstance(data, _Element):
|
|
439
449
|
data = cls._from_etree(data, info)
|
|
@@ -443,6 +453,14 @@ class BaseFeature(BaseModel, GMLAdapter, CoretableAdapter, JsonFGAdapter):
|
|
|
443
453
|
data = cls._from_jsonfg(data, info)
|
|
444
454
|
return data
|
|
445
455
|
|
|
456
|
+
@model_validator(mode="after")
|
|
457
|
+
def _ensure_any_attribute(self) -> Self:
|
|
458
|
+
if all(
|
|
459
|
+
getattr(self, field) is None for field in type(self).model_fields.keys()
|
|
460
|
+
):
|
|
461
|
+
raise ValueError("at least one field must have a value")
|
|
462
|
+
return self
|
|
463
|
+
|
|
446
464
|
@field_serializer("hatGenerAttribut", when_used="unless-none", check_fields=False)
|
|
447
465
|
def _serialize_gener_att(
|
|
448
466
|
self, v: list["BaseFeature"], info: SerializationInfo
|
|
@@ -20,7 +20,7 @@ xplan_tools/model/appschema/xplan54.py,sha256=Q4Tzfz0wu8iQCHUV14c0s1knUJq_aLzYpP
|
|
|
20
20
|
xplan_tools/model/appschema/xplan60.py,sha256=BYAsfRF769ZwK2lm3Y12r2Yf3RGJD9xN0fwVuyBmJaQ,1190936
|
|
21
21
|
xplan_tools/model/appschema/xplan61.py,sha256=lO0GIhYwqLxG4wPTxtWQ17XqYOTXkQzSyF2U80WX30k,1309344
|
|
22
22
|
xplan_tools/model/appschema/xtrasse20.py,sha256=7YmqRtacXwPuZjQDYEaftEf-2gZ6944pmwOwwSws38s,531712
|
|
23
|
-
xplan_tools/model/base.py,sha256=
|
|
23
|
+
xplan_tools/model/base.py,sha256=0FrZQWOLFD7nlKnSuOTTyWqjutgpEH9bpkFSPIYofzQ,20518
|
|
24
24
|
xplan_tools/model/migrations/env.py,sha256=G4rghfPrPjlGDvt8d7YIHWsiv2xfI8cfUJtX0o6-9hQ,1939
|
|
25
25
|
xplan_tools/model/migrations/script.py.mako,sha256=04kgeBtNMa4cCnG8CfQcKt6P6rnloIfj8wy0u_DBydM,704
|
|
26
26
|
xplan_tools/model/migrations/versions/3c3445a58565_base_schema.py,sha256=O4_oyz2T9hnAPBQMiFiTL208-QT9M1E75GM9pF_TsRI,7951
|
|
@@ -39,8 +39,8 @@ xplan_tools/transform/transformer.py,sha256=2O4Aq_eTo9e2JOUwq9tJnfv6dwOxqNDdTGPt
|
|
|
39
39
|
xplan_tools/util/__init__.py,sha256=_YR9fvj4H3fnIBh_rJtkcjgEnn5Dm1kq9pkgLzSyBCU,12585
|
|
40
40
|
xplan_tools/util/style.py,sha256=6Iyj-fsmnJylkJo-70wCFjfsbbwUGAS5QTN2IMJAVdI,7503
|
|
41
41
|
xplan_tools/util/validate.py,sha256=3inTRLHrVonfQ9FDjtvSNKlAGem5DKtEvLqW7NxwWQs,3327
|
|
42
|
-
xplan_tools-1.12.
|
|
43
|
-
xplan_tools-1.12.
|
|
44
|
-
xplan_tools-1.12.
|
|
45
|
-
xplan_tools-1.12.
|
|
46
|
-
xplan_tools-1.12.
|
|
42
|
+
xplan_tools-1.12.1.dist-info/METADATA,sha256=lYwXAntjBCLhpwHqaFRvmtFiNKirmnOdS4hHtgnIYis,4658
|
|
43
|
+
xplan_tools-1.12.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
44
|
+
xplan_tools-1.12.1.dist-info/entry_points.txt,sha256=NV98QKVV3vDuWnJtWsKZvcpEH2N7SF1yHXvVMet23Ps,52
|
|
45
|
+
xplan_tools-1.12.1.dist-info/licenses/LICENSE.md,sha256=b8nnCcy_4Nd_v_okJ6mDKCvi64jkexzbSfIag7TR5mU,13827
|
|
46
|
+
xplan_tools-1.12.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|