Make get_view_data use sqlalchemy.