I'm translating PHP code to Python code which inserts data into a MySql table.
There are four possible columns based on a naming convention: image_ + [hq,sq, lq, thumb] + _url
The php code is as follows (using Laravel DB Query):
DB::table('items')
->insertGetId(array(
'title' => $title,
'image_' . $quality . '_url' => $amazon_url,
));
The corresponding python code (using SqlAlchemy Core) which is giving me a syntax error:
item_ins = items_tbl.insert().values(title=item_title,
image_+quality+_url=amazon_url
)
How can I accomplish the same result in Python without reverting to if/else statements?