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)
| 2201 | |
| 2202 | |
| 2203 | def backref(name: str, **kwargs: Any) -> ORMBackrefArgument: |
| 2204 | """When using the :paramref:`_orm.relationship.backref` parameter, |
| 2205 | provides specific parameters to be used when the new |
| 2206 | :func:`_orm.relationship` is generated. |
| 2207 | |
| 2208 | E.g.:: |
| 2209 | |
| 2210 | "items": relationship(SomeItem, backref=backref("parent", lazy="subquery")) |
| 2211 | |
| 2212 | The :paramref:`_orm.relationship.backref` parameter is generally |
| 2213 | considered to be legacy; for modern applications, using |
| 2214 | explicit :func:`_orm.relationship` constructs linked together using |
| 2215 | the :paramref:`_orm.relationship.back_populates` parameter should be |
| 2216 | preferred. |
| 2217 | |
| 2218 | .. seealso:: |
| 2219 | |
| 2220 | :ref:`relationships_backref` - background on backrefs |
| 2221 | |
| 2222 | """ # noqa: E501 |
| 2223 | |
| 2224 | return (name, kwargs) |
| 2225 | |
| 2226 | |
| 2227 | def deferred( |
no outgoing calls