Beispiel #1
0
 def update_category(cls):
     _id = input("id: ")
     name = input("name: ")
     if Category.update(_id, name):
         print(f"Successfully update category with id:{_id} name: {name}")
         return 1, 2
     else:
         print("Category not found for update")
         return 3, 4
Beispiel #2
0
 def update_category(cls):
     print("-----update category-----")
     _id = input("category's id: ")
     new_name = input("new category's name: ")
     if not _id or not new_name:
         print("you forget enter id or new name")
     else:
         result, msg = Category.update(new_name, _id)
         if result:
             print(msg)
         else:
             print(msg)