I Have two list (a real case):
user_1_list = [(3, True), (4, True), (5, True), (6, True), (7, True), (8, True), (9, True), (12, True), (13, True), (14, True)] # 10 items
user_2_list = [(1, True), (2, True), (3, False), (4, True), (5, True), (6, True), (7, True), (8, False)] # 8 items
both lists I'm getting via sqlalchemy query:
db.query(Table.post_id, Table.bool_value).filter(Table.user_id == user_id).all()
How I can combine a single sqlalchemy query to get post_id - bool_value
pairs that present (matching) in both lists?
P.S. list with distinct pairs I also need.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…