q = session.query(Group, Member, Item, Version).join(Member).join(Item).join(
    Version).filter(Version.name == my_version).order_by(Group.number
    ).order_by(Member.number).all()
Join multiple tables in SQLAlchemy/Flask