sort poducts
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user