title: How to pass arguments to included html in Flask web application
body: <p>I am developing a blog application in python with flask. In the view function form is passed as argument to render_template which calls 'index.html'. form works in index.html as expected. But there is a {% include '' %} tag which places 'post.htm'. Now I want to use same form repeatedly in 'post.html'. How to do that? Will the passed form to index.html available to included 'post.html' also? And if so how to identify which button is pressed in the rendered page because both forms are same? My index.html file:            </p>
  
  <pre><code>{% extends "base.html" %}
  {% block content %}
    &lt;h1&gt;Hi, {{ g.user.nickname }}!&lt;/h1&gt;
    &lt;form action="" method="post" name="post"&gt;
         {{ form.hidden_tag() }}
      &lt;table&gt;
         ..........
         .......... 
         &lt;tr&gt;
            &lt;td&gt;&lt;input type="submit" value="Post!"&gt;&lt;/td&gt;
         &lt;/tr&gt;
       &lt;/table&gt;
     &lt;/form&gt;
  
  
     {% for post in posts.items %}
       &lt;div class="{{ post.id }}"&gt;
         &lt;div&gt;
            {% include 'post.html' %}
         &lt;/div&gt;
       &lt;/div&gt;
     {% endfor %}
  
  {% endblock %}
  </code></pre>
  
  <p>And my post.html as:</p>
  
  <pre><code>&lt;table&gt;
      ..........
      ..........
      &lt;tr valign="top"&gt;
          &lt;td&gt;{{ post.body }}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;form action="" method="post" name="post"&gt;
         {{ form.hidden_tag() }}
         &lt;table&gt;
             .........
             ......... 
             &lt;td&gt;&lt;input type="submit" value="Post!"&gt;&lt;/td&gt;                  
         &lt;/table&gt;
      &lt;/form&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>Is it possible to use same form on both html files. As there will be several form fields in the rendered web page, how to identify which button is pressed? 
  index.html is rendered with code:</p>
  
  <pre><code>return render_template('index.html',
                             title='Home',
                             form=form,
                             posts=posts)
  </code></pre>