TypeDAL 5.0.0__tar.gz → 5.0.1__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 (82) hide show
  1. {typedal-5.0.0 → typedal-5.0.1}/CHANGELOG.md +5 -0
  2. {typedal-5.0.0 → typedal-5.0.1}/PKG-INFO +1 -1
  3. {typedal-5.0.0 → typedal-5.0.1}/pyproject.toml +1 -1
  4. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/tables.py +3 -3
  5. {typedal-5.0.0 → typedal-5.0.1}/tests/test_mypy.py +2 -0
  6. {typedal-5.0.0 → typedal-5.0.1}/tests/test_table.py +16 -0
  7. {typedal-5.0.0 → typedal-5.0.1}/tests/test_typing_mypy.md +1 -0
  8. {typedal-5.0.0 → typedal-5.0.1}/tests/test_typing_pyright.md +1 -0
  9. {typedal-5.0.0 → typedal-5.0.1}/uv.lock +1 -1
  10. {typedal-5.0.0 → typedal-5.0.1}/.crush/.gitignore +0 -0
  11. {typedal-5.0.0 → typedal-5.0.1}/.crush/init +0 -0
  12. {typedal-5.0.0 → typedal-5.0.1}/.crush/logs/crush.log +0 -0
  13. {typedal-5.0.0 → typedal-5.0.1}/.github/workflows/su6.yml +0 -0
  14. {typedal-5.0.0 → typedal-5.0.1}/.gitignore +0 -0
  15. {typedal-5.0.0 → typedal-5.0.1}/.readthedocs.yml +0 -0
  16. {typedal-5.0.0 → typedal-5.0.1}/README.md +0 -0
  17. {typedal-5.0.0 → typedal-5.0.1}/coverage.svg +0 -0
  18. {typedal-5.0.0 → typedal-5.0.1}/docs/10_advanced_apis.md +0 -0
  19. {typedal-5.0.0 → typedal-5.0.1}/docs/11_async.md +0 -0
  20. {typedal-5.0.0 → typedal-5.0.1}/docs/1_getting_started.md +0 -0
  21. {typedal-5.0.0 → typedal-5.0.1}/docs/2_defining_tables.md +0 -0
  22. {typedal-5.0.0 → typedal-5.0.1}/docs/3_building_queries.md +0 -0
  23. {typedal-5.0.0 → typedal-5.0.1}/docs/4_relationships.md +0 -0
  24. {typedal-5.0.0 → typedal-5.0.1}/docs/5_py4web.md +0 -0
  25. {typedal-5.0.0 → typedal-5.0.1}/docs/6_migrations.md +0 -0
  26. {typedal-5.0.0 → typedal-5.0.1}/docs/7_configuration.md +0 -0
  27. {typedal-5.0.0 → typedal-5.0.1}/docs/8_mixins.md +0 -0
  28. {typedal-5.0.0 → typedal-5.0.1}/docs/9_memoization.md +0 -0
  29. {typedal-5.0.0 → typedal-5.0.1}/docs/css/code_blocks.css +0 -0
  30. {typedal-5.0.0 → typedal-5.0.1}/docs/index.md +0 -0
  31. {typedal-5.0.0 → typedal-5.0.1}/docs/requirements.txt +0 -0
  32. {typedal-5.0.0 → typedal-5.0.1}/example_new.py +0 -0
  33. {typedal-5.0.0 → typedal-5.0.1}/example_old.py +0 -0
  34. {typedal-5.0.0 → typedal-5.0.1}/mkdocs.yml +0 -0
  35. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/__about__.py +0 -0
  36. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/__init__.py +0 -0
  37. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/asynchronous.py +0 -0
  38. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/caching.py +0 -0
  39. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/cli.py +0 -0
  40. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/config.py +0 -0
  41. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/constants.py +0 -0
  42. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/core.py +0 -0
  43. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/define.py +0 -0
  44. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/enum_helpers.py +0 -0
  45. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/fields.py +0 -0
  46. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/for_py4web.py +0 -0
  47. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/for_web2py.py +0 -0
  48. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/helpers.py +0 -0
  49. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/mixins.py +0 -0
  50. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/py.typed +0 -0
  51. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/query_builder.py +0 -0
  52. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/relationships.py +0 -0
  53. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/rows.py +0 -0
  54. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/serializers/as_json.py +0 -0
  55. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/serializers/typescript.py +0 -0
  56. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/types.py +0 -0
  57. {typedal-5.0.0 → typedal-5.0.1}/src/typedal/web2py_py4web_shared.py +0 -0
  58. {typedal-5.0.0 → typedal-5.0.1}/tasks.py +0 -0
  59. {typedal-5.0.0 → typedal-5.0.1}/tests/__init__.py +0 -0
  60. {typedal-5.0.0 → typedal-5.0.1}/tests/configs/simple.toml +0 -0
  61. {typedal-5.0.0 → typedal-5.0.1}/tests/configs/valid.env +0 -0
  62. {typedal-5.0.0 → typedal-5.0.1}/tests/configs/valid.toml +0 -0
  63. {typedal-5.0.0 → typedal-5.0.1}/tests/conftest.py +0 -0
  64. {typedal-5.0.0 → typedal-5.0.1}/tests/py314_tests.py +0 -0
  65. {typedal-5.0.0 → typedal-5.0.1}/tests/test_async.py +0 -0
  66. {typedal-5.0.0 → typedal-5.0.1}/tests/test_cli.py +0 -0
  67. {typedal-5.0.0 → typedal-5.0.1}/tests/test_config.py +0 -0
  68. {typedal-5.0.0 → typedal-5.0.1}/tests/test_docs_examples.py +0 -0
  69. {typedal-5.0.0 → typedal-5.0.1}/tests/test_helpers.py +0 -0
  70. {typedal-5.0.0 → typedal-5.0.1}/tests/test_json.py +0 -0
  71. {typedal-5.0.0 → typedal-5.0.1}/tests/test_main.py +0 -0
  72. {typedal-5.0.0 → typedal-5.0.1}/tests/test_mixins.py +0 -0
  73. {typedal-5.0.0 → typedal-5.0.1}/tests/test_orm.py +0 -0
  74. {typedal-5.0.0 → typedal-5.0.1}/tests/test_py4web.py +0 -0
  75. {typedal-5.0.0 → typedal-5.0.1}/tests/test_query_builder.py +0 -0
  76. {typedal-5.0.0 → typedal-5.0.1}/tests/test_relationships.py +0 -0
  77. {typedal-5.0.0 → typedal-5.0.1}/tests/test_row.py +0 -0
  78. {typedal-5.0.0 → typedal-5.0.1}/tests/test_stats.py +0 -0
  79. {typedal-5.0.0 → typedal-5.0.1}/tests/test_typescript.py +0 -0
  80. {typedal-5.0.0 → typedal-5.0.1}/tests/test_web2py.py +0 -0
  81. {typedal-5.0.0 → typedal-5.0.1}/tests/test_xx_others.py +0 -0
  82. {typedal-5.0.0 → typedal-5.0.1}/tests/timings.py +0 -0
@@ -2,6 +2,11 @@
2
2
 
3
3
  <!--next-version-placeholder-->
4
4
 
5
+ ## v5.0.1 (2026-08-29)
6
+
7
+ ### Fix
8
+ * improved typing on 'id' field
9
+
5
10
  ### Breaking Changes
6
11
 
7
12
  * **caching:** `save_to_cache()` and `memoize()` no longer commit as a side effect of writing
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: TypeDAL
3
- Version: 5.0.0
3
+ Version: 5.0.1
4
4
  Summary: Typing support for PyDAL
5
5
  Project-URL: Documentation, https://typedal.readthedocs.io/
6
6
  Project-URL: Issues, https://github.com/trialandsuccess/TypeDAL/issues
@@ -33,7 +33,7 @@ dependencies = [
33
33
  "legacy-cgi; python_version >= '3.13'",
34
34
  "python-dateutil < 3",
35
35
  ]
36
- version = "5.0.0"
36
+ version = "5.0.1"
37
37
 
38
38
  [project.optional-dependencies]
39
39
  py4web = [
@@ -96,6 +96,8 @@ class TableMeta(type):
96
96
 
97
97
  """
98
98
 
99
+ id: "TypedField[int]" # class access; instance access is declared on _TypedTable
100
+
99
101
  # set up by db.define:
100
102
  # _db: TypeDAL | None = None
101
103
  # _table: Table | None = None
@@ -877,7 +879,7 @@ class _TypedTable(metaclass=TableMeta):
877
879
  # This class contains weird typing glue to dodge MRO headaches without losing editor/mypy table methods
878
880
  # you can safely ignore it when changing runtime behavior; touch it only for typing/mypy issues
879
881
 
880
- id: "TypedField[int]"
882
+ id: int # instance access; class access comes from TableMeta
881
883
 
882
884
  _before_insert: list[t.Callable[[t.Self], t.Optional[bool]] | t.Callable[[OpRow], t.Optional[bool]]]
883
885
  _after_insert: list[
@@ -1062,8 +1064,6 @@ class TypedTable(_TypedTable, metaclass=TableMeta):
1062
1064
  _row: Row | None = None
1063
1065
  _rows: tuple[Row, ...] = ()
1064
1066
 
1065
- id: "TypedField[int]"
1066
-
1067
1067
  _with: list[str]
1068
1068
 
1069
1069
  @classproperty
@@ -50,6 +50,8 @@ def mypy_test_typedal_define() -> None:
50
50
  db.define(LaterDefine)
51
51
  reveal_type(LaterDefine()) # R: tests.test_mypy.LaterDefine
52
52
 
53
+ reveal_type(MyTable.id) # R: typedal.fields.TypedField[int]
54
+ reveal_type(MyTable().id) # R: int
53
55
  reveal_type(MyTable.normal) # R: str
54
56
  reveal_type(MyTable().normal) # R: str
55
57
  reveal_type(MyTable.fancy) # R: typedal.fields.TypedField[str]
@@ -256,3 +256,19 @@ def test_table_with_methods():
256
256
 
257
257
  loaded = json.loads(dumped)
258
258
  assert loaded[0]["age"] == 20
259
+
260
+
261
+ def test_string_annotation_is_resolved():
262
+ # annotations reach the builder as strings on Python < 3.14, or when quoted twice
263
+ builder = db._builder
264
+
265
+ assert builder.annotation_to_pydal_fieldtype("str", {}) == "string"
266
+ assert builder.annotation_to_pydal_fieldtype("TypedField[str]", {}) == "string"
267
+
268
+
269
+ def test_as_typeddict_unwraps_typed_field():
270
+ @db.define()
271
+ class TypedDictModel(TypedTable):
272
+ generic: TypedField[str]
273
+
274
+ assert TypedDictModel.as_typeddict().__annotations__ == {"id": int, "generic": str}
@@ -43,6 +43,7 @@ for deferred_define in DeferredDefine.paginate(limit=1):
43
43
  new_row = WithBraces.insert()
44
44
 
45
45
  reveal_type(new_row) # revealed: test_snippet.WithBraces
46
+ reveal_type(WithBraces.id) # revealed: typedal.fields.TypedField[int]
46
47
  reveal_type(new_row.id) # revealed: int
47
48
 
48
49
  reveal_type(WithBraces.gid) # revealed: typedal.fields.TypedField[str]
@@ -41,6 +41,7 @@ for deferred_define in DeferredDefine.paginate(limit=1):
41
41
  new_row = WithBraces.insert()
42
42
 
43
43
  reveal_type(new_row) # revealed: WithBraces
44
+ reveal_type(WithBraces.id) # revealed: TypedField[int]
44
45
  reveal_type(new_row.id) # revealed: int
45
46
 
46
47
  reveal_type(WithBraces.gid) # revealed: TypedField[str]
@@ -2654,7 +2654,7 @@ wheels = [
2654
2654
 
2655
2655
  [[package]]
2656
2656
  name = "typedal"
2657
- version = "5.0.0"
2657
+ version = "5.0.1"
2658
2658
  source = { editable = "." }
2659
2659
  dependencies = [
2660
2660
  { name = "configurable-json" },
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes