aboutsummaryrefslogtreecommitdiff
path: root/uploader/species/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/species/views.py')
-rw-r--r--uploader/species/views.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/uploader/species/views.py b/uploader/species/views.py
index 55b0dd3..10715a5 100644
--- a/uploader/species/views.py
+++ b/uploader/species/views.py
@@ -8,11 +8,12 @@ from flask import (flash,
current_app as app)
from uploader.population import popbp
-from uploader.datautils import order_by_family
+from uploader.platforms import platformsbp
from uploader.ui import make_template_renderer
from uploader.db_utils import database_connection
from uploader.oauth2.client import oauth2_get, oauth2_post
from uploader.authorisation import require_login, require_token
+from uploader.datautils import order_by_family, enumerate_sequence
from .models import (all_species,
save_species,
@@ -23,15 +24,17 @@ from .models import (all_species,
speciesbp = Blueprint("species", __name__)
speciesbp.register_blueprint(popbp, url_prefix="/")
+speciesbp.register_blueprint(platformsbp, url_prefix="/")
render_template = make_template_renderer("species")
@speciesbp.route("/", methods=["GET"])
+@require_login
def list_species():
"""List and display all the species in the database."""
with database_connection(app.config["SQL_URI"]) as conn:
return render_template("species/list-species.html",
- allspecies=all_species(conn))
+ allspecies=enumerate_sequence(all_species(conn)))
@speciesbp.route("/<int:species_id>", methods=["GET"])
@require_login