sera-2 1.26.4__tar.gz → 1.26.5__tar.gz

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.
Files changed (56) hide show
  1. {sera_2-1.26.4 → sera_2-1.26.5}/PKG-INFO +1 -1
  2. {sera_2-1.26.4 → sera_2-1.26.5}/pyproject.toml +1 -1
  3. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/make_query.py +1 -1
  4. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_datatype.py +16 -0
  5. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_parse.py +9 -1
  6. {sera_2-1.26.4 → sera_2-1.26.5}/README.md +0 -0
  7. {sera_2-1.26.4 → sera_2-1.26.5}/sera/__init__.py +0 -0
  8. {sera_2-1.26.4 → sera_2-1.26.5}/sera/constants.py +0 -0
  9. {sera_2-1.26.4 → sera_2-1.26.5}/sera/exports/__init__.py +0 -0
  10. {sera_2-1.26.4 → sera_2-1.26.5}/sera/exports/schema.py +0 -0
  11. {sera_2-1.26.4 → sera_2-1.26.5}/sera/exports/test.py +0 -0
  12. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/__init__.py +0 -0
  13. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/api_helper.py +0 -0
  14. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/api_test_helper.py +0 -0
  15. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/base_orm.py +0 -0
  16. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/base_service.py +0 -0
  17. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/__init__.py +0 -0
  18. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_dcg.py +0 -0
  19. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_edge.py +0 -0
  20. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_flow.py +0 -0
  21. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_fn_signature.py +0 -0
  22. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_node.py +0 -0
  23. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_runtime.py +0 -0
  24. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/directed_computing_graph/_type_conversion.py +0 -0
  25. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/middlewares/__init__.py +0 -0
  26. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/middlewares/auth.py +0 -0
  27. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/middlewares/uscp.py +0 -0
  28. {sera_2-1.26.4 → sera_2-1.26.5}/sera/libs/search_helper.py +0 -0
  29. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/__init__.py +0 -0
  30. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/__main__.py +0 -0
  31. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/make_app.py +0 -0
  32. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/make_python_api.py +0 -0
  33. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/make_python_model.py +0 -0
  34. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/make_python_services.py +0 -0
  35. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/make_typescript_model.py +0 -0
  36. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/py_backend/__init__.py +0 -0
  37. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/py_backend/misc.py +0 -0
  38. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/__init__.py +0 -0
  39. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/make_class_schema.py +0 -0
  40. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/make_draft_model.py +0 -0
  41. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/make_enums.py +0 -0
  42. {sera_2-1.26.4 → sera_2-1.26.5}/sera/make/ts_frontend/misc.py +0 -0
  43. {sera_2-1.26.4 → sera_2-1.26.5}/sera/misc/__init__.py +0 -0
  44. {sera_2-1.26.4 → sera_2-1.26.5}/sera/misc/_formatter.py +0 -0
  45. {sera_2-1.26.4 → sera_2-1.26.5}/sera/misc/_utils.py +0 -0
  46. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/__init__.py +0 -0
  47. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_class.py +0 -0
  48. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_collection.py +0 -0
  49. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_constraints.py +0 -0
  50. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_default.py +0 -0
  51. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_enum.py +0 -0
  52. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_module.py +0 -0
  53. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_multi_lingual_string.py +0 -0
  54. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_property.py +0 -0
  55. {sera_2-1.26.4 → sera_2-1.26.5}/sera/models/_schema.py +0 -0
  56. {sera_2-1.26.4 → sera_2-1.26.5}/sera/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sera-2
3
- Version: 1.26.4
3
+ Version: 1.26.5
4
4
  Summary:
5
5
  Author: Binh Vu
6
6
  Author-email: bvu687@gmail.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sera-2"
3
- version = "1.26.4"
3
+ version = "1.26.5"
4
4
  description = ""
5
5
  authors = ["Binh Vu <bvu687@gmail.com>"]
6
6
  readme = "README.md"
@@ -117,7 +117,7 @@ def make_query(schema: Schema, cls: Class, pkg: Package):
117
117
  query_ops.append(('"eq" | "ne"', tstype.type))
118
118
  elif tstype.type == "Date":
119
119
  # for date type, we use iso string as the value
120
- query_ops.append(('"eq" | "ne" | "lt" | "lte" | "gt" | "gte"', "string"))
120
+ query_ops.append(('"lte" | "gte"', "string"))
121
121
  query_ops.append(('"bti"', "[string, string]"))
122
122
  else:
123
123
  raise NotImplementedError(tstype.type)
@@ -287,6 +287,22 @@ predefined_datatypes = {
287
287
  tstype=TsTypeWithDep(type="string", spectype="dict"),
288
288
  is_list=False,
289
289
  ),
290
+ "str2str": DataType(
291
+ pytype=PyTypeWithDep(type="dict[str, str]"),
292
+ sqltype=SQLTypeWithDep(
293
+ type="JSON", mapped_pytype="dict[str, str]", deps=["sqlalchemy.JSON"]
294
+ ),
295
+ tstype=TsTypeWithDep(type="Record<string, string>", spectype="str2str"),
296
+ is_list=False,
297
+ ),
298
+ "str2int": DataType(
299
+ pytype=PyTypeWithDep(type="dict[str, int]"),
300
+ sqltype=SQLTypeWithDep(
301
+ type="JSON", mapped_pytype="dict[str, int]", deps=["sqlalchemy.JSON"]
302
+ ),
303
+ tstype=TsTypeWithDep(type="Record<string, number>", spectype="str2int"),
304
+ is_list=False,
305
+ ),
290
306
  }
291
307
 
292
308
  predefined_py_datatypes = {"bytes": PyTypeWithDep(type="bytes")}
@@ -275,6 +275,14 @@ def _parse_datatype(schema: Schema, datatype: dict | str) -> DataType:
275
275
  if isinstance(datatype, dict):
276
276
  is_list = datatype.get("is_list", False)
277
277
 
278
+ # Parse Python type and argument if present
279
+ if datatype["pytype"] in predefined_py_datatypes:
280
+ py_type = predefined_py_datatypes[datatype["pytype"]]
281
+ else:
282
+ py_type = PyTypeWithDep(
283
+ type=datatype["pytype"]["type"], deps=datatype["pytype"].get("deps", [])
284
+ )
285
+
278
286
  # Parse SQL type and argument if present
279
287
  m = re.match(r"^([a-zA-Z0-9_]+)(\([^)]+\))?$", datatype["sqltype"])
280
288
  if m is not None:
@@ -291,7 +299,7 @@ def _parse_datatype(schema: Schema, datatype: dict | str) -> DataType:
291
299
  raise ValueError(f"Invalid SQL type format: {datatype['sqltype']}")
292
300
 
293
301
  return DataType(
294
- pytype=predefined_py_datatypes[datatype["pytype"]],
302
+ pytype=py_type,
295
303
  sqltype=sql_type,
296
304
  tstype=predefined_ts_datatypes[datatype["tstype"]],
297
305
  is_list=is_list,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes