From 8bad987466203baed948ba761d248e24f04ca49c Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 23 Apr 2021 17:32:35 +0300 Subject: Rewrite For Loop in a more Pythonic way --- wqflask/wqflask/api/gen_menu.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py index 18afc5ad..eaddecd7 100644 --- a/wqflask/wqflask/api/gen_menu.py +++ b/wqflask/wqflask/api/gen_menu.py @@ -23,12 +23,7 @@ def get_species(): """Build species list""" results = g.db.execute( "SELECT Name, MenuName FROM Species ORDER BY OrderId").fetchall() - - species = [] - for result in results: - species.append([str(result[0]), str(result[1])]) - - return species + return [[name, menu_name] for name, menu_name in results] def get_groups(species): -- cgit v1.2.3