We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# parse selections and generate a lookup query for sel in selection: if sel[1] and not sel[1] == "all": name = sel[0].replace("sel_", "") val = sel[1] if name == "customer": query = query.filter(Xconnect.customer == int(val)) if name == "region": query = query.filter(Xconnect.region == int(val)) if name == "lvc": query = query.filter(Xconnect.lvc == str(val)) if name == "id": query = query.filter(Xconnect.id == int(val)) if name == "conn_status": query = query.filter(Xconnect.conn_status == int(val)) if name == "environment": query = query.filter(Xconnect.environment == int(val)) if name == "client_type": query = query.filter(Xconnect.client_type == int(val)) if name == "vendor": query = query.filter(Xconnect.vendor == int(val)) if name == "comp_id": query = query.filter(Xconnect.comp_id == int(val))
Hello, I have a select field to search for DB records based on some fields, table is called Xconnect,
how do I translate a lookup string into a SQLModel object w/o using constant If/Then blocks?
is there a better way to do this than explicit if/then statements?
for example if someone searches Xconnect table where client_type == "abc"
how can I translate this into a SQL model query w/o using explicit if/then mapping, ie
if name == "client_type": query = query.filter(Xconnect.client_type == int(val))
Linux
Ubuntu 20.04
0.0.6
3.8
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
First Check
Commit to Help
Example Code
Description
Hello, I have a select field to search for DB records based on some fields, table is called Xconnect,
how do I translate a lookup string into a SQLModel object w/o using constant If/Then blocks?
is there a better way to do this than explicit if/then statements?
for example if someone searches Xconnect table where client_type == "abc"
how can I translate this into a SQL model query w/o using explicit if/then mapping, ie
Operating System
Linux
Operating System Details
Ubuntu 20.04
SQLModel Version
0.0.6
Python Version
3.8
Additional Context
No response
The text was updated successfully, but these errors were encountered: