X-Git-Url: https://apps.delaporte.us/gitweb/matrix-shop-bot.git/blobdiff_plain/b87cc9cac0fee1d8d1c281a3f445097cb8af2691..4aa9ead4e7039ccc4d6a346b8cc0d2c9d90a2cd7:/matrix_shop_bot/tasks.py diff --git a/matrix_shop_bot/tasks.py b/matrix_shop_bot/tasks.py index 54cafd1..73f57e2 100644 --- a/matrix_shop_bot/tasks.py +++ b/matrix_shop_bot/tasks.py @@ -19,7 +19,13 @@ def add_store(c, name): @task -def assign(c, store_id, item_id): +def assign(c, item_id): + result = Data().assign_last_store(item_id) + print(result) + + +@task +def assign_to_store(c, item_id, store_id): result = Data().assign_store(store_id, item_id) print(result) @@ -39,10 +45,16 @@ def clear_list(c, store_id): @task -def list(c, store_id_str=None): +def list_for_store(c, store_id): + items = Data().get_shopping_list_for_store(store_id) + for item in items: + print(item) - store_id = int(store_id_str) if store_id_str else None - items = Data().get_shopping_list(store_id) + +@task +def list(c): + '''Use previous store''' + items = Data().get_last_shopping_list() for item in items: print(item)