|
45 | 45 | def create_filters(model: Type[TypeModel], filter_info: Union[list, dict], schema: Type[TypeSchema]):
|
46 | 46 | """
|
47 | 47 | Apply filters from filters information to base query
|
| 48 | +
|
48 | 49 | :param model: the model of the node
|
49 | 50 | :param filter_info: current node filter information
|
50 | 51 | :param schema: the resource
|
@@ -91,6 +92,7 @@ def _cast_value_with_scheme(self, field_types: List[ModelField], value: Any) ->
|
91 | 92 | def create_filter(self, schema_field: ModelField, model_column, operator, value):
|
92 | 93 | """
|
93 | 94 | Create sqlalchemy filter
|
| 95 | +
|
94 | 96 | :param schema_field:
|
95 | 97 | :param model_column: column sqlalchemy
|
96 | 98 | :param operator:
|
@@ -155,9 +157,12 @@ def create_filter(self, schema_field: ModelField, model_column, operator, value)
|
155 | 157 |
|
156 | 158 | def _separate_types(self, types: List[Type]) -> Tuple[List[Type], List[Type]]:
|
157 | 159 | """
|
158 |
| - Separates the types into two kinds. The first are those for which |
| 160 | + Separates the types into two kinds. |
| 161 | +
|
| 162 | + The first are those for which |
159 | 163 | there are already validators defined by pydantic - str, int, datetime
|
160 |
| - and some other built-in types. The second are all other types for which |
| 164 | + and some other built-in types. |
| 165 | + The second are all other types for which |
161 | 166 | the `arbitrary_types_allowed` config is applied when defining the pydantic model
|
162 | 167 | """
|
163 | 168 | pydantic_types = [
|
@@ -287,7 +292,8 @@ def _relationship_filtering(self, value):
|
287 | 292 |
|
288 | 293 | def _create_filters(self, type_filter: str) -> FilterAndJoins:
|
289 | 294 | """
|
290 |
| - Создаём фильтр or или and |
| 295 | + Create or / and filters |
| 296 | +
|
291 | 297 | :param type_filter: 'or' или 'and'
|
292 | 298 | :return:
|
293 | 299 | """
|
|
0 commit comments