def __repr__(self):
    return '<Gallery - %r>' % self.title


class Photo(db.Model):
    id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(64))
href = db.Column(db.String(128))
subgallery_id = db.Column(db.Integer, db.ForeignKey('subgallery.id'))

def __repr__(self):
    return '<Photo - %r>' % self.title
Flask SQLAlchemy - Need Help Mapping 3 Classes together