Skip to content

Commit

Permalink
Add basic filter query support (closes #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoukl committed Jan 17, 2023
1 parent 1f408d2 commit a855e1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/datarest/_crudrouter_ext.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# A customized SLQAlchemyCRUDRouter subclass that adds filter query support.
# Gratefully adapted from https://github.com/awtkns/fastapi-crudrouter/pull/61

import textwrap
from typing import Any, Dict, List, Optional, Type, TypeVar, Union

Expand All @@ -8,10 +11,7 @@
)
import pydantic

from . import _database


# TODO: Refactor to separate module
T = TypeVar("T", bound=pydantic.BaseModel)
FILTER = Dict[str, Optional[Union[int, float, str, bool]]]

Expand Down Expand Up @@ -43,7 +43,6 @@ def resp_status_code(response: Response):
# - Take a look at dataclass and/or attrs
# - see also https://github.com/tiangolo/fastapi/issues/4700 for potential
# problems + hints
# Gratefully adapted from https://github.com/awtkns/fastapi-crudrouter/pull/61
def query_factory(
schema: Type[T],
query_params: Optional[List[str]] = None
Expand Down

0 comments on commit a855e1d

Please sign in to comment.