When using the :paramref:`_orm.relationship.backref` parameter, provides specific parameters to be used when the new :func:`_orm.relationship` is generated. E.g.:: "items": relationship(SomeItem, backref=backref("parent", lazy="subquery")) The :paramref:`_orm.relationship.
(name: str, **kwargs: Any)
| 2166 | |
| 2167 | |
| 2168 | def backref(name: str, **kwargs: Any) -> ORMBackrefArgument: |
| 2169 | """When using the :paramref:`_orm.relationship.backref` parameter, |
| 2170 | provides specific parameters to be used when the new |
| 2171 | :func:`_orm.relationship` is generated. |
| 2172 | |
| 2173 | E.g.:: |
| 2174 | |
| 2175 | "items": relationship(SomeItem, backref=backref("parent", lazy="subquery")) |
| 2176 | |
| 2177 | The :paramref:`_orm.relationship.backref` parameter is generally |
| 2178 | considered to be legacy; for modern applications, using |
| 2179 | explicit :func:`_orm.relationship` constructs linked together using |
| 2180 | the :paramref:`_orm.relationship.back_populates` parameter should be |
| 2181 | preferred. |
| 2182 | |
| 2183 | .. seealso:: |
| 2184 | |
| 2185 | :ref:`relationships_backref` - background on backrefs |
| 2186 | |
| 2187 | """ # noqa: E501 |
| 2188 | |
| 2189 | return (name, kwargs) |
| 2190 | |
| 2191 | |
| 2192 | def deferred( |
no outgoing calls