title: Complex routing for get request from html form in flask
body: <p>I'm trying to create complex routing for a get request that looks like this:</p>
  
  <pre><code>@app.route('/get-details?id=&lt;int:id&gt;&amp;code=&lt;int:code&gt;', methods=['GET'])
  @login_required
  def get_details(id, code):
      # Do something with code and id ....
  </code></pre>
  
  <p>And in my template I have a form that looks like this:</p>
  
  <pre><code>&lt;form action="{{url_for('get_details')}}" method="get"&gt;
      {{ form.hidden_tag() }}
      {{ form.id() }}
      {{ form.code() }}
      &lt;input type="submit"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>But when I try to render my page I get this exception:</p>
  
  <pre><code>  File "/home/sharon/dev/wiseart/credixdealer/app/templates/dashboard/form-device.html", line 113, in block "content"
      &lt;form action="{{url_for('get_details')}}" method="get"&gt;
    File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 332, in url_for
      return appctx.app.handle_url_build_error(error, endpoint, values)
    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1811, in handle_url_build_error
      reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 322, in url_for
      force_external=external)
    File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1758, in build
      raise BuildError(endpoint, values, method, self)
  BuildError: Could not build url for endpoint 'get_details'. Did you forget to specify values ['business_id', 'id']?
  </code></pre>
  
  <p>How can I specify in url_for that the parameters should be retrieved from the form itself?</p>