title: One object two foreign keys to the same table
body: <p>I need to have a post associated to two users. The author and the moderator. I am trying without success this code</p>
  
  <pre><code>class User(UserMixin, db.Model):
      __tablename__ = 'users'
      id = db.Column(db.Integer, primary_key=True)
      ...
      post = db.relationship('Post', foreign_keys=['posts.id'], backref='post_user', lazy='dynamic')
      post_blame = db.relationship('Post', foreign_keys=['posts.moderated_by'], backref='post_blame', lazy='dynamic')    
  
  class Post(db.Model):
      __tablename__ = 'posts'
      id = db.Column(db.Integer, primary_key=True)
      ...
      author_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
      moderated_by = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>ArgumentError: Column-based expression object expected for argument 'foreign_keys'; got: 'posts.id', type &lt;class 'str'&gt;
  </code></pre>