(cls, connection)
| 1870 | |
| 1871 | @classmethod |
| 1872 | def insert_data(cls, connection): |
| 1873 | User, Address = cls.classes.User, cls.classes.Address |
| 1874 | s = Session(connection) |
| 1875 | s.add_all( |
| 1876 | [ |
| 1877 | User( |
| 1878 | id=1, |
| 1879 | name="u1", |
| 1880 | addresses=[ |
| 1881 | Address(id=1, email="a1"), |
| 1882 | Address(id=2, email="a2"), |
| 1883 | ], |
| 1884 | ) |
| 1885 | ] |
| 1886 | ) |
| 1887 | s.commit() |
| 1888 | |
| 1889 | # "persistent" - we get at an Address that was already present. |
| 1890 | # With the "skip bidirectional" check removed, the "set" emits SQL |