Skip to content

Commit 9a658d4

Browse files
rename order enum
1 parent b0ff350 commit 9a658d4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## FastAPI SQLAlchemy Filter
2-
![ci_badge](https://github.com/OleksandrZhydyk/FastAPI-SQLAlchemy-Filters/actions/workflows/ci_filter.yml/badge.svg)
2+
![ci_badge](https://github.com/OleksandrZhydyk/FastAPI-SQLAlchemy-Filters/actions/workflows/CI.yml/badge.svg)
33
[![Downloads](https://static.pepy.tech/badge/fastapi_sa_orm_filter)](https://pepy.tech/project/fastapi_sa_orm_filter)
44
[![PyPI version](https://img.shields.io/pypi/v/fastapi-sa-orm-filter.svg)](https://pypi.org/project/fastapi-sa-orm-filter/)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

fastapi_sa_orm_filter/operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ class Operators(str, Enum):
2121
not_between = "not_between"
2222

2323

24-
class Sequence(str, Enum):
24+
class OrderSequence(str, Enum):
2525
desc = "desc"
2626
asc = "asc"

fastapi_sa_orm_filter/parsers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from fastapi_sa_orm_filter.dto import ParsedFilter
55
from fastapi_sa_orm_filter.exceptions import SAFilterOrmException
66
from fastapi_sa_orm_filter.operators import Operators as ops
7-
from fastapi_sa_orm_filter.operators import Sequence
7+
from fastapi_sa_orm_filter.operators import OrderSequence
88

99

1010
class OrderByQueryParser:
@@ -20,10 +20,10 @@ def get_order_by_query(self, order_by_query_str: str) -> list[UnaryExpression]:
2020
for field in order_by_fields:
2121
if '-' in field:
2222
column = getattr(self._model, field.strip('-'))
23-
order_by_query.append(getattr(column, Sequence.desc)())
23+
order_by_query.append(getattr(column, OrderSequence.desc)())
2424
else:
2525
column = getattr(self._model, field.strip('+'))
26-
order_by_query.append(getattr(column, Sequence.asc)())
26+
order_by_query.append(getattr(column, OrderSequence.asc)())
2727
return order_by_query
2828

2929
def _validate_order_by_fields(self, order_by_query_str: str) -> list[str]:

0 commit comments

Comments
 (0)