order by name
This commit is contained in:
parent
21ea1aa56f
commit
fd3e8751fe
@ -65,7 +65,7 @@ def get_products():
|
|||||||
try:
|
try:
|
||||||
conn = psycopg2.connect()
|
conn = psycopg2.connect()
|
||||||
with conn.cursor() as cursor:
|
with conn.cursor() as cursor:
|
||||||
cursor.execute('SELECT name FROM nutrition_table')
|
cursor.execute('SELECT name FROM nutrition_table ORDER BY name')
|
||||||
products = cursor.fetchall()
|
products = cursor.fetchall()
|
||||||
return {'products': [product[0] for product in products]}
|
return {'products': [product[0] for product in products]}
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user