Skip to content

Export

This module provides the route for the export page. It handles GET requests to display fish data, including all available fish and uncaught fish.

export_route(app)

Register the export page route with the Flask app.

Parameters:

Name Type Description Default
app Flask

The Flask application instance.

required
Source code in src/routes/export.py
Python
def export_route(app):
    """
    Register the export page route with the Flask app.

    Args:
        app (Flask): The Flask application instance.
    """
    @app.route("/export")
    def export():
        """
        Handles requests to the '/export' route.
        """
        logging.debug("Handling request to 'export' route")
        return render_template(
            "export.html",
            fish_list=ut.all_fish_list,
            uncaught_fish=ut.uncaught,
            fish_list_json=json.dumps(ut.all_fish_list),
            uncaught_fish_json=json.dumps(sorted(ut.uncaught, key=str.lower))
        )