sera-2 1.20.12__py3-none-any.whl → 1.20.13__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.
sera/libs/api_helper.py CHANGED
@@ -91,7 +91,7 @@ def parse_query(
91
91
  v = [norm_func(x) for x in v]
92
92
  else:
93
93
  v = norm_func(v)
94
- except ValueError:
94
+ except (ValueError, KeyError):
95
95
  if debug:
96
96
  raise HTTPException(
97
97
  status_code=status_codes.HTTP_400_BAD_REQUEST,
sera/models/_datatype.py CHANGED
@@ -78,6 +78,19 @@ class PyTypeWithDep:
78
78
  return ("TypeConversion.to_float", "sera.libs.api_helper.TypeConversion")
79
79
  if self.type == "bool":
80
80
  return ("TypeConversion.to_bool", "sera.libs.api_helper.TypeConversion")
81
+ if any(
82
+ dep.find(".models.enums.") != -1 and dep.endswith(self.type)
83
+ for dep in self.deps
84
+ ):
85
+ # This is an enum type, we directly use the enum constructor as the conversion function
86
+ return (
87
+ self.type,
88
+ [
89
+ dep
90
+ for dep in self.deps
91
+ if dep.find(".models.enums.") != -1 and dep.endswith(self.type)
92
+ ][0],
93
+ )
81
94
  else:
82
95
  raise NotImplementedError()
83
96
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sera-2
3
- Version: 1.20.12
3
+ Version: 1.20.13
4
4
  Summary:
5
5
  Author: Binh Vu
6
6
  Author-email: bvu687@gmail.com
@@ -4,7 +4,7 @@ sera/exports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  sera/exports/schema.py,sha256=wEBUrDOyuCoCJC8X4RlmoWpeqSugaboG-9Q1UQ8HEzk,7824
5
5
  sera/exports/test.py,sha256=jK1EJmLGiy7eREpnY_68IIVRH43uH8S_u5Z7STPbXOM,2002
6
6
  sera/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- sera/libs/api_helper.py,sha256=-75GzGNboJnFUp45pxckDSBvOrnrA2Tw_UAZBnSK_20,6665
7
+ sera/libs/api_helper.py,sha256=lSnnNz-LzNaWmb5g7ic9bpJHl9IQd8u1GqH1kHFR3xk,6677
8
8
  sera/libs/api_test_helper.py,sha256=3tRr8sLN4dBSrHgKAHMmyoENI0xh7K_JLel8AvujU7k,1323
9
9
  sera/libs/base_orm.py,sha256=5hOH_diUeaABm3cpE2-9u50VRqG1QW2osPQnvVHIhIA,3365
10
10
  sera/libs/base_service.py,sha256=V6wug1QA5KD0FsQU9r1XQmLUTB85E6oIR2e12Fi1IE0,6457
@@ -33,7 +33,7 @@ sera/models/__init__.py,sha256=vJC5Kzo_N7wd16ocNPy1VvAZDGNiWeiAhWJ4ihATKvA,780
33
33
  sera/models/_class.py,sha256=1J4Bd_LanzhhDWwZFHWGtFYD7lupe_alaB3D02ebNDI,2862
34
34
  sera/models/_collection.py,sha256=nLlP85OfEhfj4pFAYxB5ZvtBN6EdPSWPJ5ZFh5SSEC4,2686
35
35
  sera/models/_constraints.py,sha256=RpWDU-TfCslXaMUaTG9utWbl5z8Z6nzvF_fhqlek6ew,1987
36
- sera/models/_datatype.py,sha256=Whfdyt3X0-T_eLi-K38P8V-87AMna69R_1yeqWwjjXI,10611
36
+ sera/models/_datatype.py,sha256=RUKXwOjTr4YTloB0KQcOOAARXamoqMDXGtZ_xjldwD4,11095
37
37
  sera/models/_default.py,sha256=ABggW6qdPR4ZDqIPJdJ0GCGQ-7kfsfZmQ_DchgZEa-I,137
38
38
  sera/models/_enum.py,sha256=sy0q7E646F-APsqrVQ52r1fAQ_DCAeaNq5YM5QN3zIk,2070
39
39
  sera/models/_module.py,sha256=I-GfnTgAa-5R87qTAvEzOt-VVEGeFBBwubGCgUkXVSw,5159
@@ -42,6 +42,6 @@ sera/models/_parse.py,sha256=9iaW-8Ajq8e440FrTJ-X9oivHJJ447kPU-ZqffFxSvw,12649
42
42
  sera/models/_property.py,sha256=9yMDxrmbyuF6-29lQjiq163Xzwbk75TlmGBpu0NLpkI,7485
43
43
  sera/models/_schema.py,sha256=VxJEiqgVvbXgcSUK4UW6JnRcggk4nsooVSE6MyXmfNY,1636
44
44
  sera/typing.py,sha256=m4rir-fB6Cgcm7_ZSXXcNdla2LJgq96WXxtTTrDaJno,1058
45
- sera_2-1.20.12.dist-info/METADATA,sha256=KspmNESywYnx1I-C6I_QzElaqC3-07W11VyQ6a9CbrE,937
46
- sera_2-1.20.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
47
- sera_2-1.20.12.dist-info/RECORD,,
45
+ sera_2-1.20.13.dist-info/METADATA,sha256=Z0AAY0cKuVh4__UTmDqCXW0LQygzBeVrM50JOYp1-wY,937
46
+ sera_2-1.20.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
47
+ sera_2-1.20.13.dist-info/RECORD,,