querymodelling 0.0.3__tar.gz → 0.0.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.
- {querymodelling-0.0.3/querymodelling.egg-info → querymodelling-0.0.5}/PKG-INFO +1 -1
- {querymodelling-0.0.3 → querymodelling-0.0.5}/pyproject.toml +1 -1
- querymodelling-0.0.5/querymodelling/__helper__.py +8 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/__version__.py +1 -1
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/sql.py +15 -1
- {querymodelling-0.0.3 → querymodelling-0.0.5/querymodelling.egg-info}/PKG-INFO +1 -1
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling.egg-info/SOURCES.txt +1 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/AUTHORS.rst +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/LICENSE +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/README.md +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/__init__.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/base.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/fields.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/model.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling/pydantic.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling.egg-info/dependency_links.txt +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling.egg-info/requires.txt +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/querymodelling.egg-info/top_level.txt +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/setup.cfg +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/setup.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/tests/__init__.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/tests/__main__.py +0 -0
- {querymodelling-0.0.3 → querymodelling-0.0.5}/tests/basic_test.py +0 -0
|
@@ -4,6 +4,7 @@ from sqlalchemy.orm.attributes import InstrumentedAttribute
|
|
|
4
4
|
from typing import TypeVar, Sequence, Type, Callable, ParamSpec
|
|
5
5
|
from pydantic import AliasChoices
|
|
6
6
|
|
|
7
|
+
from .__helper__ import is_enum
|
|
7
8
|
from .base import get_functions, DefaultSort
|
|
8
9
|
from .fields import QueryField, SortField
|
|
9
10
|
from .model import PageQuery
|
|
@@ -112,7 +113,8 @@ def create_callback(
|
|
|
112
113
|
property_name]
|
|
113
114
|
|
|
114
115
|
json_schema_extra = json_schema_extra | {
|
|
115
|
-
"query.backend": "sql"
|
|
116
|
+
"query.backend": "sql",
|
|
117
|
+
"query.field": field_name,
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
if annotation == str:
|
|
@@ -144,6 +146,18 @@ def create_callback(
|
|
|
144
146
|
operator_mapping,
|
|
145
147
|
json_schema_extra
|
|
146
148
|
)
|
|
149
|
+
elif is_enum(annotation):
|
|
150
|
+
operator_mapping = {
|
|
151
|
+
None: lambda value: field == value,
|
|
152
|
+
"not": lambda value: field != value
|
|
153
|
+
}
|
|
154
|
+
yield from create_query_fields(
|
|
155
|
+
base_field,
|
|
156
|
+
field_name,
|
|
157
|
+
annotation,
|
|
158
|
+
operator_mapping,
|
|
159
|
+
json_schema_extra
|
|
160
|
+
)
|
|
147
161
|
sort_name = f"sort_{field_name}"
|
|
148
162
|
sort_name_dot = f"sort.{field_name}"
|
|
149
163
|
yield (
|
|
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
|