sort poducts

This commit is contained in:
2025-12-04 11:38:12 +02:00
parent 0801266120
commit d8c6de1f2b

View File

@@ -69,7 +69,7 @@ class Products:
with sqlite3.connect(self.db_path) as conn: with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor() cursor = conn.cursor()
cursor.execute(""" cursor.execute("""
SELECT * FROM products SELECT * FROM products ORDER BY name ASC;
""") """)
rows = cursor.fetchall() rows = cursor.fetchall()
if rows: if rows:
@@ -99,6 +99,7 @@ class Products:
cursor.execute(""" cursor.execute("""
SELECT * FROM products SELECT * FROM products
WHERE category_id = ? WHERE category_id = ?
ORDER BY name ASC;
""", (category_id,)) """, (category_id,))
rows = cursor.fetchall() rows = cursor.fetchall()
if rows: if rows: