Skip to content

Commit

Permalink
linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 19, 2024
1 parent 593719b commit 180c5f0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/models-library/src/models_library/rest_ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ class OrderDirection(str, Enum):

class OrderBy(BaseModel):
# Based on https://google.aip.dev/132#ordering
field: IDStr = Field(..., description="field name identifier")
direction: OrderDirection = Field(
default=OrderDirection.ASC,
description=(
f"As [A,B,C,...] if `{OrderDirection.ASC.value}`"
f" or [Z,Y,X, ...] if `{OrderDirection.DESC.value}`"
field: Annotated[IDStr, Field(..., description="field name identifier")]
direction: Annotated[
OrderDirection,
Field(
default=OrderDirection.ASC,
description=(
f"As [A,B,C,...] if `{OrderDirection.ASC.value}`"
f" or [Z,Y,X, ...] if `{OrderDirection.DESC.value}`"
),
),
)
]


class _BaseOrderQueryParams(RequestParameters):
Expand Down

0 comments on commit 180c5f0

Please sign in to comment.