From 4b3c76d1a7ad63a8db374ea4b07161a3130d5edd Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Fri, 2 Feb 2024 12:00:10 -0500 Subject: [PATCH] refactored breed combinations to pairs --- app.py | 14 +++++++------- templates/breeds.html | 17 ++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app.py b/app.py index 8e8a015..8c964e4 100644 --- a/app.py +++ b/app.py @@ -134,14 +134,14 @@ def get_breeding_combinations(): if breed_id is None: return jsonify({"error": f"No breed information found for {selected_monster}"}) - base_combinations, mate_combinations = get_breeding_info(breed_id) + base_pair, mate_pair = get_breeding_pairs(breed_id) return render_template( "breeds.html", selected_monster={ "name": selected_monster, - "base_combinations": base_combinations, - "mate_combinations": mate_combinations, + "base_pair": base_pair, + "mate_pair": mate_pair, }, ) @@ -167,7 +167,7 @@ def get_breed_id(target_monster): return None -def get_breeding_info(breed_id): +def get_breeding_pairs(breed_id): cursor = g.db.cursor() # Fetch base and mate breeding combinations based on the breed ID @@ -182,18 +182,18 @@ def get_breeding_info(breed_id): breeding_info = cursor.fetchall() - base_combinations = [ + base_pair = [ value for (requirement_type, value) in breeding_info if requirement_type == "base" ] - mate_combinations = [ + mate_pair = [ value for (requirement_type, value) in breeding_info if requirement_type == "mate" ] - return base_combinations, mate_combinations + return base_pair, mate_pair @app.route("/footer") diff --git a/templates/breeds.html b/templates/breeds.html index 91fd703..3a3bf41 100644 --- a/templates/breeds.html +++ b/templates/breeds.html @@ -5,22 +5,22 @@ - Breeding Combinations + Breeding Pairs -
+
{% if selected_monster %}

Breeding Pairs

Base

    - {% for combination in selected_monster.base_combinations %} + {% for pair in selected_monster.base_pair %}
  • - {{ combination }}{{ pair }}
  • {% endfor %} @@ -29,11 +29,11 @@

    Mates

      - {% for combination in selected_monster.mate_combinations %} + {% for pair in selected_monster.mate_pair %}
    • - {{ combination }}{{ pair }}
    • {% endfor %} @@ -42,6 +42,5 @@
    {% endif %}
-