Hi All,
Looking for some suggestions on the most efficient way to query my datatable using a list of dictionaries or combination of requirements.
Lets say I have a list of dict like:
my_data = [
{"ProdName": "ProdA", "Location":"UK", ...},
{"ProdName": "ProdB", "Location":"IT", ...},
{"ProdName": "ProdB", "Location":"US", ...},
{"ProdName": "ProdC", "Location":"UK", ...},
....
]
I would like to fetch all the db rows where the rows match the combination of ProdName and Location per row. So based on the list provided above, I would hope to get all the rows where (ProdName=ProdA & Location=UK) and (ProdName=ProdB & Location=IT) and (ProdName=ProdB & Location=US) and etc…
I’ve tried using q.all_of but can’t quite see how to get the syntax right or even if this is the right query operator to use for a multi-column combination search. I’ve considered the code below but doubt it’s even close to right.
db_rows = app_tables.my_table.search(
q.all_of(*some_combo_of_queries?)
)
Thanks in advance,