title: SQLAlchemy Return All Distinct Column Values
body: <p>I am creating a website using Flask and SQLAlchemy.  This website keeps track of classes that a student has taken.  I would like to find a way to search my database using SQLAlchemy to find all unique classes that have been entered.  Here is code from my <code>models.py</code> for Class:</p>
  
  <pre><code>class Class(db.Model):
      __tablename__ = 'classes'
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(100))
      body = db.Column(db.Text)
      created = db.Column(db.DateTime, default=datetime.datetime.now)
      user_email = db.Column(db.String(100), db.ForeignKey(User.email))
      user = db.relationship(User)
  </code></pre>
  
  <p>In other words, I would like to get all unique values from the title column and pass that to my <code>views.py</code>.</p>