title: Ordering query data from html template in flask
body: <p>I am ordering the query result using time but I want to give the user the ability to choose the way he wants to order data lets say he wants to use alphabetical order or he wants to order with ascending or descending order I want to know how to that in flask, sorry for my bad English</p>
  <p>this is my code</p>
  <pre><code>@routes.route('/posts')
  def show_posts():
      page=request.args.get('page',1,type=int)
      posts=Posts.query.order_by(Posts.timestamp.desc).paginate(page,per_page=10)
      return render_template('routes/show_posts.html',posts=posts)
  </code></pre>