Linked Questions

20 votes
2 answers
22k views

I want a query with multiple value like where id in (3,4,5) Then I have a my_list = [3,4,5] so how can I pass that list as an argument to filter in sqlalchemy? query = Notification.query.filter_by(...
Ricardo's user avatar
  • 8,381
-1 votes
1 answer
2k views

I have a list of values and I want to filter this sqlalchemy query based on if a value is in that list. Something like this: def get_values(db: Session= l = [23, 34, 54] qr = db.query(table).filter(...
MoRoPoPi's user avatar
0 votes
1 answer
1k views

I am trying to create variable of users whose ID is in list but i dont know how. This is what I tried but it doesnt work. Does someone know how to filter it correctly? list = [1, 2, 3, 4] users = ...
Martin Tošner's user avatar
2 votes
0 answers
133 views

I have a problem with writing a Query using SQL ALchemy, I am running in Python 3.6. I need to filter the content of a column in my SQLite Database using parameters contained in an array. So far I ...
Camilla Tac's user avatar
9 votes
1 answer
5k views

I'm looking to execute this query using sqlalchemy. SELECT name, age, favorite_color, favorite_food FROM kindergarten_classroom WHERE (favorite_color, favorite_food) IN ((...
crunkchitis's user avatar
2 votes
3 answers
21k views

I have one problem when i try to execute that simple request : params['_filter_items'] = (12345) sql = """ SELECT * FROM items WHERE items.items IN %(_filter_items)s""" # session is a db ...
Anouar Mokhtari's user avatar
1 vote
1 answer
4k views

I'm using Flask-SQLAlchemy and I have a few tables from a database. I'm trying to select all the rows with a specific id, to run a function. Right now I'm doing it using an if statement like this: ...
Nath's user avatar
  • 65
0 votes
1 answer
5k views

I have a pretty reasonable use case: Multiple possible filter_by matches for a single column. Basically, a multiselect JS dropdown on front end posts multiple company industries to the backend. I need ...
Michael Paccione's user avatar
3 votes
2 answers
2k views

I'm trying to build a filter statement from kwargs that may contain lists as values: def delete_object(self, from_table, filters, commit=True): (self._session .query(from_table) ...
wasp256's user avatar
  • 6,352
1 vote
1 answer
1k views

I keep receiving the error: sqlalchemy.exc.ArgumentError: Object 1 is not legal as a SQL literal value when executing this query: cat_list = [1,2,3,4,5,6] my_cats = Category.query.filter(Category.id....
user1563247's user avatar
0 votes
1 answer
1k views

Assuming I have a Postgres-DB table looking like this (with with many more rows): |------|-------| |col1 |col 2 | |------|-------| |a1 |10 | |a2 |55 | |a3 |24 | |------|-------|...
Sebastian Hätälä's user avatar
1 vote
1 answer
744 views

I have a Kanji (Japanese characters) list which looks like: kanji_n3 = ['政', '議', '民', '連'] # But then with 367 Kanji and I have 2 tables: TableKanji and TableMisc. TableMisc has a column called '...
NumesSanguis's user avatar
  • 6,452
0 votes
1 answer
707 views

I've created a small booking application where the client can book for a service, i've also made a form search where the client can search in a specific date to book. The results should be all the ...
swordfish's user avatar
  • 959
2 votes
0 answers
725 views

I have a use case in which Task A of DAG1 should run once the TASK B and TASK C of DAG2 are completed. I am using ExternalTaskSensor, but to achieve this scenario I have to create two different ...
Piyush's user avatar
  • 21
-1 votes
3 answers
367 views

In sql commed, where condition i'm using in operator along with a variable, now i've to pass value in this variable, what would be right syntax for this: select col1 from testtable where col2 in :...
ashish's user avatar
  • 249

15 30 50 per page