Issue with flask sqlalchemy code

This below code is returning nonetype object not iterable… after reloading the page via ajax in flask… meaning no result

course = db.session.query(course_p_table).filter(course_p_table.course_p_id.in_((reg_courses)))options(load_only(*rows)).all()