title: Passing data to a Bootstrap modal in jinja template (one of them from inside a for loop)
body: <p>I have a jinja template with 2 variables (one of them inside a for loop) and I want to pass them to a bootstrap modal in order to confirm a delete that is triggered within the loop.
  The schema of it is something like this:</p>
  
  <pre><code>&lt;object_outside_loop&gt;
  &lt;!-- Loop --&gt;
  {% for item_inside_loop in items %}
      &lt;button type="button" data-toggle="modal"&gt;Delete&lt;/button&gt;
  {% endfor %}
  
  &lt;!-- Modal --&gt;
  &lt;my-modal-here&gt;
      &lt;a href="{{ url_for('delete_something', id1=object_outside_loop._id, id2=item_inside_loop._id) }}" &gt;Confirm Delete&lt;/a&gt;
  &lt;/my-modal-here&gt;
  </code></pre>
  
  <p>and I need to pass both variables (id1 and id2) from the modal to my route:</p>
  
  <pre><code>@app.route("/delete_something/&lt;id1&gt;/&lt;id2&gt;")
  def delete_something(id1, id2):
  
      mongo.db.something.update_one(
          {"_id": ObjectId(id2)},
          {"$pull": {"something": {"_id": ObjectId(id1)}}},
      )
      flash("Your something has been updated!", "success")
      return redirect(url_for("somewhere", id=id2))
  </code></pre>
  
  <p>How can I pass those two variables to the modal, and how do I do that without breaking the endpoint?</p>