title: Import WTForm class to update content
body: <p>I've got this class in folder module &gt; Book.py</p>
  <pre><code>from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)
  app.config['SQLALCHEMY_DATABASE_URI'] = &quot;sqlite:///new-books-collection.db&quot;
  db = SQLAlchemy(app)
  
  class Book(db.Model):
      __tablename__ = &quot;Books&quot;
      id = db.Column(db.Integer, primary_key=True, autoincrement=True)
      title = db.Column(db.String(250), unique=True, nullable=False)
      author = db.Column(db.String(250), nullable=False)
      rating = db.Column(db.String(2), nullable=False)
  </code></pre>
  <p>and i want to import in main.py</p>
  <p><code>from module.Book import Book</code></p>
  <p>I made my CRUD and everythings works except for the update.
  This is the function</p>
  <pre><code>@app.route(&quot;/edit&quot;, methods=[&quot;GET&quot;, &quot;POST&quot;])
  def edit():
      if request.method == &quot;POST&quot;:
          book_id = 1
          book = Book.query.get(book_id)
          book.title = request.form['title']
          book.author = request.form['author']
          book.rating = request.form['rating']
          print(book.rating) # print the updated rating
          db.session.commit() # but commit seems doesn't work
          return redirect(url_for('home'))
  
      book_id = request.args.get('id')
      book = Book.query.get(book_id)
      
      return render_template(&quot;edit_add.html&quot;, book=book)
  </code></pre>
  <p>Can some one figure it out?</p>
  <p>Can some one figure it out?</p>