removing items and developing adding items

This commit is contained in:
BarsTiger
2022-08-03 22:44:30 +03:00
parent 0820452e97
commit 7c27c8520e
15 changed files with 955 additions and 178 deletions

View File

@@ -13,3 +13,11 @@ class Database:
with open(Config.get().database, 'w') as f:
json.dump(default_database, f, indent=4)
return DatabaseModel.from_dict(default_database)
@staticmethod
def remove_item(item_name: str):
db = Database.get()
db.items.pop(item_name)
with open(Config.get().database, 'w') as f:
json.dump(db.to_dict(), f, indent=4)