class MessageModel(Base):
    __tablename__ = 'messages'
player_id = Column(Integer, ForeignKey('chats.id'), nullable=False)
message = Column(String(2000), nullable=False)
time = Column(TIMESTAMP, server_default=func.now())
player = relationship(PlayerModel, backref='messages')
How to achieve inner join using SQLAlchemy?