You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using FastAPI and just installed SQLModel to test it.
For this use case (GET request), end user should be able to select one or multiple options which would be used to filter entries to return (Like Site or OS Type). Each field is optional, and I can't strictly determine/know in advance which item will have to be used as a WHERE CLAUSE.
In the same way, if end user let all field to Default (None/Null), the where clause will be used in the request, but with no filters.
So, as I'm doing with SQLAlchemy, I can create a dictionary and push it into my request, and it will automatically take the dictionary key and transform them in WHERE Clauses through the filter_by function.
But I didn't find a way to the same with SQLModel. it seems that we have to "statically" specify which items we want to use as filters.
Am I missing something ?
If not, how can we do the job with SQLModel ?
Here is the error message I have :
Exception:..... TypeError: where() got an unexpected keyword argument 'platform'
(Which seems to be normal, as we can't use keywords argument in a where, as explained in the documentation)
Thanks a lot for your support,
Operating System
Linux
Operating System Details
FastAPI runs into a Docker container.
SQLModel Version
0.0.3
Python Version
3.8.6
Additional Context
No response
The text was updated successfully, but these errors were encountered:
First Check
Commit to Help
Example Code
Description
I'm using FastAPI and just installed SQLModel to test it.
For this use case (GET request), end user should be able to select one or multiple options which would be used to filter entries to return (Like Site or OS Type). Each field is optional, and I can't strictly determine/know in advance which item will have to be used as a WHERE CLAUSE.
In the same way, if end user let all field to Default (None/Null), the where clause will be used in the request, but with no filters.
So, as I'm doing with SQLAlchemy, I can create a dictionary and push it into my request, and it will automatically take the dictionary key and transform them in WHERE Clauses through the filter_by function.
But I didn't find a way to the same with SQLModel. it seems that we have to "statically" specify which items we want to use as filters.
Am I missing something ?
If not, how can we do the job with SQLModel ?
Here is the error message I have :
Exception:..... TypeError: where() got an unexpected keyword argument 'platform'
(Which seems to be normal, as we can't use keywords argument in a where, as explained in the documentation)
Thanks a lot for your support,
Operating System
Linux
Operating System Details
FastAPI runs into a Docker container.
SQLModel Version
0.0.3
Python Version
3.8.6
Additional Context
No response
The text was updated successfully, but these errors were encountered: