clear-skies 1.22.8__py3-none-any.whl → 1.22.9__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.22.8.dist-info → clear_skies-1.22.9.dist-info}/METADATA +1 -1
- {clear_skies-1.22.8.dist-info → clear_skies-1.22.9.dist-info}/RECORD +5 -5
- clearskies/column_types/has_many.py +4 -2
- {clear_skies-1.22.8.dist-info → clear_skies-1.22.9.dist-info}/LICENSE +0 -0
- {clear_skies-1.22.8.dist-info → clear_skies-1.22.9.dist-info}/WHEEL +0 -0
|
@@ -74,7 +74,7 @@ clearskies/column_types/datetime.py,sha256=xtuZpUC9fA16i1oO80kPIx--8RDPuei9RdsDD
|
|
|
74
74
|
clearskies/column_types/datetime_micro.py,sha256=ewQSniCc2MmNIyX2XNuNcCIwh5Fpf1HcvpLfzB8lz8g,382
|
|
75
75
|
clearskies/column_types/email.py,sha256=qq0Yo_C3KxUqT68q2HWXocBBR4xwMqjxcIdgZRv218U,584
|
|
76
76
|
clearskies/column_types/float.py,sha256=j8jJeBueSOusPtAFCWgLHYBncfLnqT1U7bh1zcAkYiA,1332
|
|
77
|
-
clearskies/column_types/has_many.py,sha256=
|
|
77
|
+
clearskies/column_types/has_many.py,sha256=vcx6QU-LH-4hh_-LNfDBePt80hIFebSpTreGLh86pVc,7681
|
|
78
78
|
clearskies/column_types/has_one.py,sha256=uphIPUuHLwwmhljLMaKKPujR6TYTT7onn-hHUF6S_IY,2230
|
|
79
79
|
clearskies/column_types/integer.py,sha256=dGIluusPmhLRNg7PplOJLbQI2AXojqRBUHt8ekYWNVI,1386
|
|
80
80
|
clearskies/column_types/json.py,sha256=TbZkdwCoZYhbALUxof2jENGfaq2i5TlcyBcmo7XzDGQ,652
|
|
@@ -207,7 +207,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
|
|
|
207
207
|
clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
|
|
208
208
|
clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
|
|
209
209
|
clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
|
|
210
|
-
clear_skies-1.22.
|
|
211
|
-
clear_skies-1.22.
|
|
212
|
-
clear_skies-1.22.
|
|
213
|
-
clear_skies-1.22.
|
|
210
|
+
clear_skies-1.22.9.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
|
|
211
|
+
clear_skies-1.22.9.dist-info/METADATA,sha256=jJUINjTnq9DEn8oKxCaaKK6RruZUT0zRkVBJUGo3D0s,1817
|
|
212
|
+
clear_skies-1.22.9.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
213
|
+
clear_skies-1.22.9.dist-info/RECORD,,
|
|
@@ -4,6 +4,7 @@ from collections import OrderedDict
|
|
|
4
4
|
from ..autodoc.schema import Array as AutoDocArray
|
|
5
5
|
from ..autodoc.schema import Object as AutoDocObject
|
|
6
6
|
from ..autodoc.schema import String as AutoDocString
|
|
7
|
+
from ..functional import validations
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class HasMany(Column):
|
|
@@ -50,7 +51,8 @@ class HasMany(Column):
|
|
|
50
51
|
+ f"'{model_class.__name__}'"
|
|
51
52
|
)
|
|
52
53
|
self.validate_models_class(configuration["child_models_class"])
|
|
53
|
-
configuration
|
|
54
|
+
if not configuration.get("parent_id_column_name"):
|
|
55
|
+
configuration["parent_id_column_name"] = model_class.id_column_name
|
|
54
56
|
|
|
55
57
|
# if readable_child_columns is set then load up the child models/columns now, because we'll need it in the
|
|
56
58
|
# _check_configuration step, but we don't want to load it there because we can't save it back into the config
|
|
@@ -129,7 +131,7 @@ class HasMany(Column):
|
|
|
129
131
|
for index, where in enumerate(wheres):
|
|
130
132
|
if callable(where):
|
|
131
133
|
children = self.di.call_function(where, model=children, children=children, parent_data=data)
|
|
132
|
-
if not children:
|
|
134
|
+
if not validations.is_model(children):
|
|
133
135
|
raise ValueError(
|
|
134
136
|
f"Configuration error for column '{self.name}' in model '{self.model_class.__name__}': when 'where' is a callable, it must return a models class, but when the callable in where entry #{index+1} was called, it did not return the models class"
|
|
135
137
|
)
|
|
File without changes
|
|
File without changes
|