clear-skies 1.18.26__py3-none-any.whl → 1.18.28__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.
Potentially problematic release.
This version of clear-skies might be problematic. Click here for more details.
- {clear_skies-1.18.26.dist-info → clear_skies-1.18.28.dist-info}/METADATA +1 -1
- {clear_skies-1.18.26.dist-info → clear_skies-1.18.28.dist-info}/RECORD +7 -6
- clearskies/column_types/column.py +7 -0
- clearskies/column_types/created_by_routing_data.py +24 -0
- clearskies/handlers/base.py +1 -12
- {clear_skies-1.18.26.dist-info → clear_skies-1.18.28.dist-info}/LICENSE +0 -0
- {clear_skies-1.18.26.dist-info → clear_skies-1.18.28.dist-info}/WHEEL +0 -0
|
@@ -59,11 +59,12 @@ clearskies/column_types/audit.py,sha256=meDFV0s4u9i6UojN5f6EQk_kh-nGP8xPscCRa2Nd
|
|
|
59
59
|
clearskies/column_types/belongs_to.py,sha256=a64yQ1kWRiljOfHToGsyKbAqdgNLvbRKBYEzrp1IWXo,10714
|
|
60
60
|
clearskies/column_types/boolean.py,sha256=1yyM1CUfgD84pPE65c1OP1Qjf_J0Z45hjPrDR51AUkQ,1878
|
|
61
61
|
clearskies/column_types/category_tree.py,sha256=PgNmzZPyqYS5NADH_QTCxLvDXZFxzv5ESKTkvPrrLXo,9140
|
|
62
|
-
clearskies/column_types/column.py,sha256=
|
|
62
|
+
clearskies/column_types/column.py,sha256=PUrFyA2KmSyAZTAiJPfHy5Dlc1YPEb62c7r0BOTkF1s,13541
|
|
63
63
|
clearskies/column_types/created.py,sha256=R8P3egUb7JEHoU_NtbmN9OIwBUHQ0XFi1GoAb5RpSkI,339
|
|
64
64
|
clearskies/column_types/created_by_authorization_data.py,sha256=--1w1TOSo2CMwrpn6Y_iorl2RTqLgG8MbR8k27qreew,1108
|
|
65
65
|
clearskies/column_types/created_by_header.py,sha256=5sY6vjtra-BrAgUE4zkuLhBtzCVWHNtJPwMozPw_7_s,520
|
|
66
66
|
clearskies/column_types/created_by_ip.py,sha256=wwCUoEwHEVGN89x4xP7NJ6QR85Aum6v3JmxofoQrqtg,395
|
|
67
|
+
clearskies/column_types/created_by_routing_data.py,sha256=hIJytOLpNk0MO1Vnl_1lmAF_9uI5xG9MMvzWncm5rIY,537
|
|
67
68
|
clearskies/column_types/created_by_user_agent.py,sha256=sSYDRrqSjsCwcYlhF_s9NO-iDww3PaH6aO2ATp_SKGQ,419
|
|
68
69
|
clearskies/column_types/datetime.py,sha256=MuVaeI6FMgevTdgv6djZjlHogs72TC1HTuYdw_6MF2M,3824
|
|
69
70
|
clearskies/column_types/email.py,sha256=rCaCFCxGhVzJcYVeGm98S6e7myJ6eQX9YznqAZIgwQI,606
|
|
@@ -122,7 +123,7 @@ clearskies/functional/string.py,sha256=Jmz8G9PW41THIRfDT2WXtRk3yzJG3Zt4DKH6X2C2p
|
|
|
122
123
|
clearskies/functional/validations.py,sha256=f1fTQ4rdFZouxoovAPg-YAgf0Q0QNpKEzxWWL7EFUHI,645
|
|
123
124
|
clearskies/handlers/__init__.py,sha256=YIQeKkkFhXwn7Rcc7Qllh2RGkKB0nDjt1nwowqEuJ3E,968
|
|
124
125
|
clearskies/handlers/advanced_search.py,sha256=UbWDntGAGD5NM61yKEws5MfG0Xy3K_fn-i-X9FG-mKs,13746
|
|
125
|
-
clearskies/handlers/base.py,sha256=
|
|
126
|
+
clearskies/handlers/base.py,sha256=veR6tLPS0T9dOB9cilb6b3ausgsu5bcqEqLkMuNjJvg,22428
|
|
126
127
|
clearskies/handlers/callable.py,sha256=2pVMwllttNui4R5vlLpufPehAPL_ksh-5eBrUprNv8U,8113
|
|
127
128
|
clearskies/handlers/create.py,sha256=xj_hVYma2sKDK5Vq_R9wo8f0ZXfGlXTkYU71AMyKF2U,1232
|
|
128
129
|
clearskies/handlers/crud_by_method.py,sha256=BOkPX-LUvQrbRLSbyTfRh4c8nPF51dZEXSKOl7m9ZYA,435
|
|
@@ -188,7 +189,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
|
|
|
188
189
|
clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
|
|
189
190
|
clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
|
|
190
191
|
clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
|
|
191
|
-
clear_skies-1.18.
|
|
192
|
-
clear_skies-1.18.
|
|
193
|
-
clear_skies-1.18.
|
|
194
|
-
clear_skies-1.18.
|
|
192
|
+
clear_skies-1.18.28.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
|
|
193
|
+
clear_skies-1.18.28.dist-info/METADATA,sha256=VVxXpgRfawmK_G5zsOiPIhfxGwnook8Hwy1ECLIzhgs,1367
|
|
194
|
+
clear_skies-1.18.28.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
195
|
+
clear_skies-1.18.28.dist-info/RECORD,,
|
|
@@ -18,6 +18,7 @@ class Column(ABC):
|
|
|
18
18
|
"is_temporary",
|
|
19
19
|
"on_change",
|
|
20
20
|
"default",
|
|
21
|
+
"setable",
|
|
21
22
|
]
|
|
22
23
|
|
|
23
24
|
def __init__(self, di):
|
|
@@ -190,6 +191,12 @@ class Column(ABC):
|
|
|
190
191
|
"""
|
|
191
192
|
if not model.exists and "default" in self.configuration and self.name not in data:
|
|
192
193
|
data[self.name] = self.configuration["default"]
|
|
194
|
+
if "setable" in self.configuration:
|
|
195
|
+
setable = self.configuration["setable"]
|
|
196
|
+
if callable(setable):
|
|
197
|
+
data[self.name] = self.di.call_function(setable, data=data, model=model)
|
|
198
|
+
else:
|
|
199
|
+
data[self.name] = setable
|
|
193
200
|
return data
|
|
194
201
|
|
|
195
202
|
def post_save(self, data, model, id):
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from .string import String
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CreatedByRoutingData(String):
|
|
5
|
+
required_configs = [
|
|
6
|
+
"routing_data_name",
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
def __init__(self, di):
|
|
10
|
+
super().__init__(di)
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def is_writeable(self):
|
|
14
|
+
return False
|
|
15
|
+
|
|
16
|
+
def pre_save(self, data, model):
|
|
17
|
+
if model.exists:
|
|
18
|
+
return data
|
|
19
|
+
|
|
20
|
+
input_output = self.di.build("input_output", cache=True)
|
|
21
|
+
return {
|
|
22
|
+
**data,
|
|
23
|
+
self.name: input_output.get_request_header(self.config("routing_data_name")),
|
|
24
|
+
}
|
clearskies/handlers/base.py
CHANGED
|
@@ -73,17 +73,6 @@ class Base(ABC):
|
|
|
73
73
|
if configuration.get("output_map") is not None:
|
|
74
74
|
if not callable(configuration["output_map"]):
|
|
75
75
|
raise ValueError("'output_map' should be a callable")
|
|
76
|
-
signature = inspect.getfullargspec(configuration["output_map"])
|
|
77
|
-
if signature.defaults and len(signature.defaults):
|
|
78
|
-
raise ValueError(
|
|
79
|
-
"'output_map' should be a callable that accepts one parameter: the model. "
|
|
80
|
-
+ "However, the provided one accepts kwargs"
|
|
81
|
-
)
|
|
82
|
-
if len(signature.args) != 1:
|
|
83
|
-
raise ValueError(
|
|
84
|
-
"'output_map' should be a callable that accepts one parameter: the model. "
|
|
85
|
-
+ f"However, the provided one accepts {len(signature.args)}"
|
|
86
|
-
)
|
|
87
76
|
number_casings = 0
|
|
88
77
|
internal_casing = configuration.get("internal_casing")
|
|
89
78
|
if internal_casing and internal_casing not in string.casings:
|
|
@@ -267,7 +256,7 @@ class Base(ABC):
|
|
|
267
256
|
|
|
268
257
|
def _model_as_json(self, model, input_output):
|
|
269
258
|
if self.configuration("output_map"):
|
|
270
|
-
return self.configuration("output_map")
|
|
259
|
+
return self._di.call_function(self.configuration("output_map"), model=model)
|
|
271
260
|
|
|
272
261
|
if self._as_json_map is None:
|
|
273
262
|
self._as_json_map = self._build_as_json_map(model)
|
|
File without changes
|
|
File without changes
|