title: Flask-SQLAlchemy: Update a One to Many Relationship
body: <p>I have two Models:</p>
  
  <pre><code>class Project(db.Model):
      __tablename__ = 'project'
  
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.String(64))
      timestamp = db.Column(db.DateTime)
      info = db.Column(db.Text(255))
  
      post = db.relationship('Post', backref=db.backref('projects'))
  
  class Post(db.Model):
      __tablename__ = 'post'
  
      id = db.Column(db.Integer, primary_key=True)
      headline = db.Column(db.String(64))
      content = db.Column(db.Text(255))
      timestamp = db.Column(db.DateTime)
  
      projectId = db.Column(db.Integer, db.ForeignKey('project.id'))
  </code></pre>
  
  <p>If I, e.g., create an instance of post and append it to a project via <code>projectInstance.append(post(headline="...", content="..."))</code><br>
   Now  I want to update the project to which the post should belong to. Is there an easier way besides querying the desired project, append the post to it and remove it from the old project?  </p>
  
  <pre><code>oldProject.remove(post)
  newProject.append(post)
  </code></pre>