title: How do I get rid of a post from a flask blog?
body: <p>I made a blog and want to get rid of a blog post thought the front end. And I have some trouble with it and getting the error</p>
  
  <pre><code>"sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.int' is not mapped"
  </code></pre>
  
  <p>I think that the view is messed up but i am not too sure. Would love any feedback, Thanks!!</p>
  
  <pre><code>home.html
  &lt;span class="pull-right"&gt;&lt;a class="text-danger" href="{{ url_for('delete_post', posts_id=posts.id) }}"&gt;[delete]&lt;/a&gt;&lt;/span&gt;
  
  views
  @app.route('/delete_post/&lt;int:posts_id&gt;/', methods=('GET', 'POST'))
  def delete_post(posts_id):
      posts = Blogpost.query.filter_by(id=posts_id).first_or_404()
      db.session.delete(posts_id)
      db.session.commit()
      return redirect(url_for('home'))
  
  models
  class Blogpost(db.Model):
  id = db.Column(db.Integer, primary_key=True)
  title = db.Column(db.String(50))
  author = db.Column(db.String(20))
  date_posted = db.Column(db.DateTime)
  content = db.Column(db.Text)
  </code></pre>