title: Redirect with data parameter in flask
body: <p>I was trying to learn flask and came across the following problem.This is the example that i was trying to implement. </p>
  
  <pre><code>@app.route('/poll', methods = ['GET', 'POST'])
  def poll():
      form = PollForm()
  
      if form.validate_on_submit():
          return render_template('details.html', form = form)
  
      return render_template('poll.html', form=form)
  </code></pre>
  
  <p>But i wanted to have a different url mapping for details.html, for that purpose i created another route as,</p>
  
  <pre><code>@app.route('/details/&lt;form&gt;')
  def details(): 
     return render_template('details.html', form = form):
  </code></pre>
  
  <p>For using this i have used </p>
  
  <pre><code>return redirect(url_for('details', form=form))
  </code></pre>
  
  <p>in poll method inside the if condition. And when i tried to access the same from <strong>detail.html</strong> , i am not able to get it as a object. When tried to replace form with a string, it worked fine. Could you please suggest some mechanism to access form as an object inside the <strong>/details</strong> route ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I was asking something like this is possible.</p>
  
  <pre><code> @app.route('/poll', methods = ['GET', 'POST'])
      def poll():
          form = PollForm()
  
          if form.validate_on_submit():
          @app.route('/details')
              return render_template('details.html', form = form)
  
          return render_template('poll.html', form=form)
  </code></pre>
  
  <p>whenever we get inside the if condition the url will be <strong>/poll/details</strong>.Or is there any
   way to make this kind of <strong>url nesting</strong>, starting from a root url then child urls gets added depending on the business logic.</p>