MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / foreign

Function foreign

lib/sqlalchemy/orm/relationships.py:238–255  ·  view source on GitHub ↗

Annotate a portion of a primaryjoin expression with a 'foreign' annotation. See the section :ref:`relationship_custom_foreign` for a description of use. .. seealso:: :ref:`relationship_custom_foreign` :func:`.remote`

(expr: _CEA)

Source from the content-addressed store, hash-verified

236
237
238def foreign(expr: _CEA) -> _CEA:
239 """Annotate a portion of a primaryjoin expression
240 with a 'foreign' annotation.
241
242 See the section :ref:`relationship_custom_foreign` for a
243 description of use.
244
245 .. seealso::
246
247 :ref:`relationship_custom_foreign`
248
249 :func:`.remote`
250
251 """
252
253 return _annotate_columns( # type: ignore
254 coercions.expect(roles.ColumnArgumentRole, expr), {"foreign": True}
255 )
256
257
258@dataclasses.dataclass

Calls 1

_annotate_columnsFunction · 0.85