1class Person(db.Model):
2 id = db.Column(db.Integer, primary_key=True)
3 name = db.Column(db.String(50), nullable=False)
4 addresses = db.relationship('Address', backref='person', lazy=True)
5
6class Address(db.Model):
7 id = db.Column(db.Integer, primary_key=True)
8 email = db.Column(db.String(120), nullable=False)
9 person_id = db.Column(db.Integer, db.ForeignKey('person.id'),
10 nullable=False)
11