(cls, connection)
| 1893 | |
| 1894 | @classmethod |
| 1895 | def insert_data(cls, connection): |
| 1896 | User, Address = cls.classes.User, cls.classes.Address |
| 1897 | s = Session(connection) |
| 1898 | s.add_all( |
| 1899 | [ |
| 1900 | User( |
| 1901 | id=1, |
| 1902 | name="u1", |
| 1903 | addresses=[ |
| 1904 | Address(id=1, email="a1"), |
| 1905 | Address(id=2, email="a2"), |
| 1906 | ], |
| 1907 | ) |
| 1908 | ] |
| 1909 | ) |
| 1910 | s.commit() |
| 1911 | |
| 1912 | # "persistent" - we get at an Address that was already present. |
| 1913 | # With the "skip bidirectional" check removed, the "set" emits SQL |