likes = db.Table('likes', db.Column('user_id', db.Integer, db.ForeignKey(
    'user.id')), db.Column('post_id', db.Integer, db.ForeignKey('post.id')))
SQLAlchemy ordering by count on a many to many relationship