diff options
-rw-r--r-- | uploader/species/models.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/uploader/species/models.py b/uploader/species/models.py index bde38ce..481f8be 100644 --- a/uploader/species/models.py +++ b/uploader/species/models.py @@ -8,8 +8,8 @@ def all_species(conn: mdb.Connection) -> tuple: "Retrieve the species from the database." with conn.cursor(cursorclass=DictCursor) as cursor: cursor.execute( - "SELECT SpeciesId, SpeciesName, LOWER(Name) AS Name, MenuName, " - "FullName, TaxonomyId FROM Species") + "SELECT Id AS SpeciesId, SpeciesName, LOWER(Name) AS Name, " + "MenuName, FullName, TaxonomyId FROM Species") return tuple(cursor.fetchall()) return tuple() @@ -18,8 +18,9 @@ def species_by_id(conn: mdb.Connection, speciesid) -> dict: "Retrieve the species from the database by id." with conn.cursor(cursorclass=DictCursor) as cursor: cursor.execute( - "SELECT SpeciesId, SpeciesName, LOWER(Name) AS Name, MenuName, " - "FullName FROM Species WHERE SpeciesId=%s", + "SELECT Id AS SpeciesId, SpeciesName, LOWER(Name) AS Name, " + "MenuName, FullName, TaxonomyId, Family, FamilyOrderId, OrderId " + "FROM Species WHERE SpeciesId=%s", (speciesid,)) return cursor.fetchone() |