Skip to content

odmantic.reference

odmantic.reference.Reference(*, key_name=None)

Used to define reference fields.

Parameters:

Name Type Description Default
key_name Optional[str]

name of the Mongo key that stores the foreign key

None

Source code in odmantic/reference.py
def Reference(*, key_name: Optional[str] = None) -> Any:
    """Used to define reference fields.

    Args:
        key_name: name of the Mongo key that stores the foreign key

    <!--
    #noqa: DAR201
    -->
    """
    return ODMReferenceInfo(key_name=key_name)