Skip to content
Discussion options

You must be logged in to vote

Here is what I did:

ids = [1, 17, 202]

param_names = [f'?id_{id}?' for id in ids]
result = commands.query(
        f"""
            SELECT * FROM template WHERE id IN ({','.join(param_names)}) 
        """,
       model=Template,
        param={f'id_{id}': id for id in ids}
    )

This seems to work

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zschumacher
Comment options

@arieroos
Comment options

@zschumacher
Comment options

Answer selected by arieroos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants