Add check_clothe function to verify clothing existence in the database

This commit is contained in:
Mabe
2026-09-24 19:33:43 -07:00
parent 98e9b28bae
commit d268cb01d5
+1
View File
@@ -95,6 +95,7 @@ def fetch_all_pieces():
result = session.query(Items.pieces).all() result = session.query(Items.pieces).all()
return [row[0] for row in session.query(Items.pieces).all()] return [row[0] for row in session.query(Items.pieces).all()]
#Checks if clothe is in db
def check_clothe(clothe_type): def check_clothe(clothe_type):
exists = session.query(Items.clothes).filter_by(clothes=clothe_type).first() is not None exists = session.query(Items.clothes).filter_by(clothes=clothe_type).first() is not None
return exists return exists