removing items and developing adding items

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

No files matched your search

+8
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)