Using sqlalchemy paginate with multiple entities at once #650
-
Hello everyone, I'm trying to use Here's an example of the query I'm trying to paginate: I'm getting Pydantic validation errors for all fields, and I suspect that this might be because the query execution returns a tuple with the entities when multiple entities are selected. Has anyone else encountered this issue and found a solution? Any help or suggestions would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @gfguilherme, Could you please show what your schema looks like? Could you please try to use a schema like this? class SearchOut(BaseModel):
user: UserOut = Field(..., alias="User")
group: GroupOut = Field(..., alias="Group")
class Config:
orm_mode = True |
Beta Was this translation helpful? Give feedback.
@gfguilherme Could you please try code bellow: