Пример #1
0
    def test_person(self):
        with self.app.app_context():

            p0 = Person(first_name='zack', last_name='zhu')
            d0 = Dependent(first_name='adela', last_name='zhu')
            print(p0.type)
            print(d0.type)

            u0 = User(username='******',
                      email='*****@*****.**',
                      first_name='zack',
                      last_name='zhu')
            u0.dependents.append(d0)
            db.session.add(u0)
            db.session.commit()
            print(p0.type)
            print(d0.type)