SQLAlchemy Return All Distinct Column Values
titles = [r.title for r in session.query(Class.title).distinct()]
query = session.query(Class.title.distinct().label("title"))
titles = [row.title for row in query.all()]
Using the model query structure you could do this
Class.query.with_entities(Class.title).distinct()