

def fill_db(db, Model1, Model2):
    model1_obj1 = Model1('test1_val_1', 'test2_val_1', bool_field=True)
    model1_obj2 = Model1('test1_val_2', 'test2_val_2', bool_field=False)
    model1_obj3 = Model1('test1_val_3', 'test2_val_3')
    model1_obj4 = Model1('test1_val_4', 'test2_val_4')
    model2_obj1 = Model2('test2_val_1', model1=model1_obj1, float_field=None)
    model2_obj2 = Model2('test2_val_2', model1=model1_obj2, float_field=None)
    model2_obj3 = Model2('test2_val_3', int_field=5000, float_field=25.9)
    model2_obj4 = Model2('test2_val_4', int_field=9000, float_field=75.5)
    model2_obj5 = Model2('test2_val_5', int_field=6169453081680413441)
    date_obj1 = Model1('date_obj1', date_field=date(2014, 11, 17))
    date_obj2 = Model1('date_obj2', date_field=date(2013, 10, 16))
    timeonly_obj1 = Model1('timeonly_obj1', time_field=time(11, 10, 9))
    timeonly_obj2 = Model1('timeonly_obj2', time_field=time(10, 9, 8))
    datetime_obj1 = Model1('datetime_obj1', datetime_field=datetime(2014, 4, 3, 1, 9, 0))
    datetime_obj2 = Model1('datetime_obj2', datetime_field=datetime(2013, 3, 2, 0, 8, 0))
    enum_obj1 = Model1('enum_obj1', enum_field='model1_v1')
    enum_obj2 = Model1('enum_obj2', enum_field='model1_v2')
    empty_obj = Model1(test2='empty_obj')
    db.session.add_all([model1_obj1, model1_obj2, model1_obj3, model1_obj4, model2_obj1, model2_obj2, model2_obj3, model2_obj4, model2_obj5, date_obj1, timeonly_obj1, datetime_obj1, date_obj2, timeonly_obj2, datetime_obj2, enum_obj1, enum_obj2, empty_obj])
    db.session.commit()

dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tests/sqla/test_basic.py fill_db/original