Created
July 24, 2014 18:11
-
-
Save treystout/604e9c18a30c71980d3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __update_generic(something, some_id, some_val): | |
rows = 0 | |
with pool.cursor() as c: | |
rows = c.execute("UPDATE products SET %s=%%s WHERE product_id=%%s" % | |
something, (some_val, some_id)) | |
return rows | |
set_description = partial(__update_generic, 'description') | |
set_materials = partial(__update_generic, 'materials') | |
set_price = partial(__update_generic, 'price_usd') | |
set_shopify_id = partial(__update_generic, 'ext_shopify_product_id') | |
set_length = partial(__update_generic, 'dim_length_in') | |
set_width = partial(__update_generic, 'dim_width_in') | |
set_height = partial(__update_generic, 'dim_height_in') | |
set_published = partial(__update_generic, 'is_published') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment