title: Flask with Jinja issue with pagination after the first page
body: <p>I have created a dropdown menu to search for parts by project number from an SQL database. The first page loads with the correct parts but any pages subsequent give the error of:</p>
  
  <blockquote>
    <p>TypeError: show_compound() missing 1 required positional argument: 'search_string'</p>
  </blockquote>
  
  <p>From what I've seen online it seems I may need to use <code>*args</code> or pass the <code>search_string</code> to the template but I am unsure of how to use <code>*args</code> or where to insert the <code>search_string</code> value on the template.</p>
  
  <pre><code>@parts_database.route('/searchcompound', methods=['GET', 'POST'])
  @login_required
  def compounds_search():
      form = ProjectSearch(request.form)
      if form.validate_on_submit():
          search_string = form.select.data.project_number
  
          return show_compound(search_string)
  
      return render_template('parts_database/search_compounds.html', form=form)
  
  @parts_database.route('/showcompound', methods=['GET'])
  @login_required
  def show_compound(search_string):
      page = request.args.get('page', 1, type=int)
  
      pagination = PartsTable.query.filter_by(project_number=search_string).order_by(PartsTable.part_number).paginate(page, per_page=15, error_out=False)
  
      compound = pagination.items
      page_10 = pagination.next_num+9
      if page_10 &gt; pagination.pages:
          pageincrement = pagination.pages
      else:
          pageincrement = page_10
  
      page_decrement = page - 10
      if page_decrement &lt; 1:
          page_decrement = 1
  
      return render_template('parts_database/showpartstable.html', compound=compound, pagination=pagination, pageincrement=pageincrement, page_decrement=page_decrement)
  </code></pre>
  
  <p>template :</p>
  
  <pre><code>{% extends "base.html" %}
  {% import "bootstrap/wtf.html" as wtf %}
  {% import "_macros.html" as macros %}
  
  {% block title %}Amos{% endblock %}
  
  {% block page_content %}
  &lt;div class="page-header"&gt;
      &lt;a href="{{ url_for('main.render_csv', jobname_filename = 'Parts_PDB') }}"&gt;&lt;h1&gt;Parts&lt;/h1&gt;&lt;/a&gt;
  
  {% include 'parts_database/_showpartstable.html' %}
      {% if pagination %}
      &lt;div class="pagination"&gt;
      {{ macros.pagination_widget(page_decrement, pageincrement, pagination, '.show_compound') }}
  &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;    
  {% endblock %}
  </code></pre>