querymodelling 0.0.4__tar.gz → 0.0.6__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 (23) hide show
  1. {querymodelling-0.0.4/querymodelling.egg-info → querymodelling-0.0.6}/PKG-INFO +1 -1
  2. {querymodelling-0.0.4 → querymodelling-0.0.6}/pyproject.toml +1 -1
  3. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/__version__.py +1 -1
  4. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/sql.py +3 -13
  5. {querymodelling-0.0.4 → querymodelling-0.0.6/querymodelling.egg-info}/PKG-INFO +1 -1
  6. {querymodelling-0.0.4 → querymodelling-0.0.6}/AUTHORS.rst +0 -0
  7. {querymodelling-0.0.4 → querymodelling-0.0.6}/LICENSE +0 -0
  8. {querymodelling-0.0.4 → querymodelling-0.0.6}/README.md +0 -0
  9. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/__helper__.py +0 -0
  10. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/__init__.py +0 -0
  11. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/base.py +0 -0
  12. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/fields.py +0 -0
  13. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/model.py +0 -0
  14. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling/pydantic.py +0 -0
  15. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling.egg-info/SOURCES.txt +0 -0
  16. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling.egg-info/dependency_links.txt +0 -0
  17. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling.egg-info/requires.txt +0 -0
  18. {querymodelling-0.0.4 → querymodelling-0.0.6}/querymodelling.egg-info/top_level.txt +0 -0
  19. {querymodelling-0.0.4 → querymodelling-0.0.6}/setup.cfg +0 -0
  20. {querymodelling-0.0.4 → querymodelling-0.0.6}/setup.py +0 -0
  21. {querymodelling-0.0.4 → querymodelling-0.0.6}/tests/__init__.py +0 -0
  22. {querymodelling-0.0.4 → querymodelling-0.0.6}/tests/__main__.py +0 -0
  23. {querymodelling-0.0.4 → querymodelling-0.0.6}/tests/basic_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: querymodelling
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: build consistent api query models for fastapi
5
5
  Author: George Haddad
6
6
  Author-email: George Haddad <georgeh87@live.de>
@@ -11,7 +11,7 @@ testpaths = ["tests"]
11
11
 
12
12
  [project]
13
13
  name = "querymodelling"
14
- version = "0.0.4"
14
+ version = "0.0.6"
15
15
  description = "build consistent api query models for fastapi"
16
16
  readme = "README.md"
17
17
  requires-python = ">=3.11"
@@ -1,7 +1,7 @@
1
1
  __title__ = "querymodelling"
2
2
  __description__ = ""
3
3
  __url__ = "https://querymodelling.readthedocs.io"
4
- __version__ = "0.0.4"
4
+ __version__ = "0.0.6"
5
5
  __build__ = 0x023100
6
6
  __author__ = "George Haddad"
7
7
  __author_email__ = "georgeh87@live.de"
@@ -2,7 +2,6 @@ from datetime import datetime
2
2
  from sqlmodel import Session, select, func
3
3
  from sqlalchemy.orm.attributes import InstrumentedAttribute
4
4
  from typing import TypeVar, Sequence, Type, Callable, ParamSpec
5
- from pydantic import AliasChoices
6
5
 
7
6
  from .__helper__ import is_enum
8
7
  from .base import get_functions, DefaultSort
@@ -70,20 +69,14 @@ def create_query_fields(
70
69
  json_schema_extra: dict
71
70
  ):
72
71
  for operator, operator_function in operator_mapping.items():
73
- validation_alias = None
74
- alias = None
75
72
  if operator is None:
76
73
  name = field_name
77
74
  else:
78
75
  name = f"{field_name}_{operator}"
79
- alias = f"{field_name}.{operator}"
80
- validation_alias = AliasChoices(name, alias)
81
76
  yield (
82
77
  name,
83
78
  QueryField(base_field)(
84
79
  operator_function,
85
- alias=alias,
86
- validation_alias=validation_alias,
87
80
  default=None,
88
81
  json_schema_extra=json_schema_extra | {
89
82
  "query.operator": operator
@@ -113,7 +106,8 @@ def create_callback(
113
106
  property_name]
114
107
 
115
108
  json_schema_extra = json_schema_extra | {
116
- "query.backend": "sql"
109
+ "query.backend": "sql",
110
+ "query.field": field_name,
117
111
  }
118
112
 
119
113
  if annotation == str:
@@ -157,14 +151,10 @@ def create_callback(
157
151
  operator_mapping,
158
152
  json_schema_extra
159
153
  )
160
- sort_name = f"sort_{field_name}"
161
- sort_name_dot = f"sort.{field_name}"
162
154
  yield (
163
- sort_name_dot,
155
+ f"sort_{field_name}",
164
156
  SortField(base_field)(
165
157
  sortable_by(source_type.__dict__[field_name]),
166
- alias=sort_name_dot,
167
- validation_alias=AliasChoices(sort_name, sort_name_dot),
168
158
  default=None,
169
159
  json_schema_extra=json_schema_extra
170
160
  ),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: querymodelling
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: build consistent api query models for fastapi
5
5
  Author: George Haddad
6
6
  Author-email: George Haddad <georgeh87@live.de>
File without changes
File without changes
File without changes
File without changes