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)
| 236 | |
| 237 | |
| 238 | def 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 |